121 originalCanvas = canvas;
155 state->clipRectCount = 0;
158 for (
int i = 0; i < 9; i++) {
159 state->matrix[i] = matrix.get(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++) {
247 matrix.set(i,
state.matrix[i]);
253 if (
state.clipRectCount > 0) {
254 bounds.setLTRB(
state.clipRects[0].left,
255 state.clipRects[0].top,
256 state.clipRects[0].right,
257 state.clipRects[0].bottom);
258 for (
int i = 1; i <
state.clipRectCount; ++i) {
259 bounds.join({
state.clipRects[i].left,
260 state.clipRects[i].top,
261 state.clipRects[i].right,
262 state.clipRects[i].bottom});
270static std::unique_ptr<SkCanvas>
318 for (
int i = state_v1->
layerCount - 1; i >= 0; --i) {
@ 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)
struct SkCanvasLayerState::@429::@432 gpu
struct SkCanvasLayerState::@429::@431 raster
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)