121 originalCanvas = canvas;
155 state->clipRectCount = 0;
158 for (
int i = 0;
i < 9;
i++) {
169 state->clipRectCount = 1;
182 if (canvas->androidFramework_isClipAA()) {
186 std::unique_ptr<SkCanvasState_v1> canvasState(
new SkCanvasState_v1(canvas));
199 if (!
device->accessPixels(&pmap) || 0 == pmap.width() || 0 == pmap.height()) {
203 if (!
device->isPixelAlignedToGlobal()) {
212 layerState->
x = origin.
x();
213 layerState->
y = origin.
y();
214 layerState->
width = pmap.width();
215 layerState->
height = pmap.height();
217 switch (pmap.colorType()) {
218 case kN32_SkColorType:
234 canvasState->layerCount = 1;
236 layerWriter.flatten(canvasState->layers);
238 return canvasState.release();
246 for (
int i = 0;
i < 9;
i++) {
253 if (
state.clipRectCount > 0) {
255 state.clipRects[0].top,
256 state.clipRects[0].right,
257 state.clipRects[0].bottom);
258 for (
int i = 1;
i <
state.clipRectCount; ++
i) {
262 state.clipRects[
i].bottom});
270static std::unique_ptr<SkCanvas>
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
static std::unique_ptr< SkCanvas > make_canvas_from_canvas_layer(const SkCanvasLayerState &layerState)
static void setup_canvas_from_MC_state(const SkMCState &state, SkCanvas *canvas)
@ kARGB_8888_RasterConfig
static void setup_MC_state(SkMCState *state, const SkMatrix &matrix, const SkIRect &clip)
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kUnknown_SkColorType
uninitialized
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
SK_API void sk_free(void *)
static void * sk_malloc_throw(size_t size)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static SkCanvasState * CaptureCanvasState(SkCanvas *canvas)
static std::unique_ptr< SkCanvas > MakeFromCanvasState(const SkCanvasState *state)
static void ReleaseCanvasState(SkCanvasState *state)
SkCanvasState_v1(SkCanvas *canvas)
static const int32_t kVersion
SkCanvasLayerState * layers
SkCanvasState(int32_t version, SkCanvas *canvas)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
virtual SkISize getBaseLayerSize() const
SkMatrix getTotalMatrix() const
SkIRect getDeviceClipBounds() const
void concat(const SkMatrix &matrix)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
struct SkCanvasLayerState::@423::@425 raster
struct SkCanvasLayerState::@423::@426 gpu
constexpr int32_t y() const
static constexpr SkIPoint Make(int32_t x, int32_t y)
constexpr int32_t x() const
static constexpr SkIRect MakeEmpty()
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkRect Make(const SkISize &size)