Flutter Engine
The Flutter Engine
Surface_makeImageSnapshot_2.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(Surface_makeImageSnapshot_2, 256, 64, false, 0) {
5void draw(SkCanvas* canvas) {
11 lil->draw(big->getCanvas(), 16, 16);
12 sk_sp<SkImage> later(big->makeImageSnapshot({0, 0, 16, 16}));
13 canvas->drawImage(early, 0, 0);
14 canvas->drawImage(later, 0, 0);
15}
16} // END FIDDLE
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
REG_FIDDLE(Surface_makeImageSnapshot_2, 256, 64, false, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void clear(SkColor color)
Definition: SkCanvas.h:1199
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
SkCanvas * getCanvas()
Definition: SkSurface.cpp:82
sk_sp< SkSurface > makeSurface(const SkImageInfo &imageInfo)
Definition: SkSurface.cpp:108
void draw(SkCanvas *canvas, SkScalar x, SkScalar y, const SkSamplingOptions &sampling, const SkPaint *paint)
Definition: SkSurface.cpp:116
sk_sp< SkImage > makeImageSnapshot()
Definition: SkSurface.cpp:90
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)