Flutter Engine
The Flutter Engine
Classes | Typedefs | Functions | Variables
image.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkFont.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSerialProcs.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTypeface.h"
#include "include/core/SkTypes.h"
#include "include/encode/SkJpegEncoder.h"
#include "include/encode/SkPngEncoder.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/ganesh/SkImageGanesh.h"
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "include/private/base/SkMalloc.h"
#include "src/core/SkAutoPixmapStorage.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h"
#include "src/image/SkImage_Base.h"
#include "tools/GpuToolUtils.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"
#include <functional>
#include <utility>

Go to the source code of this file.

Classes

class  ImageGM
 
class  ScalePixelsGM
 

Typedefs

typedef sk_sp< SkImage >(* ImageMakerProc) (const SkImageInfo &, GrRecordingContext *, void(*) (SkCanvas *))
 

Functions

static void draw_contents (SkSurface *surface, SkColor fillC)
 
static void test_surface (SkCanvas *canvas, SkSurface *surf, bool usePaint)
 
static void draw_pixmap (SkCanvas *canvas, const SkPixmap &pmap)
 
static void show_scaled_pixels (SkCanvas *canvas, SkImage *image)
 
static void draw_contents (SkCanvas *canvas)
 
static sk_sp< SkImagemake_raster (const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
 
static sk_sp< SkImagemake_picture (const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
 
static sk_sp< SkImagemake_codec (const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
 
static sk_sp< SkImagemake_gpu (const SkImageInfo &info, GrRecordingContext *ctx, void(*draw)(SkCanvas *))
 
 DEF_SIMPLE_GM_CAN_FAIL (new_texture_image, canvas, errorMsg, 280, 115)
 
static void draw_pixmap (SkCanvas *canvas, const SkPixmap &pm, SkScalar x, SkScalar y)
 
static void slam_ff (const SkPixmap &pm)
 
 DEF_SIMPLE_GM (scalepixels_unpremul, canvas, 1080, 280)
 
static sk_sp< SkImagemake_lazy_image ()
 
static sk_sp< SkImageserial_deserial (SkImage *img)
 
 DEF_SIMPLE_GM_CAN_FAIL (image_subset, canvas, errorMsg, 440, 220)
 

Variables

const SkSamplingOptions gSamplings []
 

Typedef Documentation

◆ ImageMakerProc

typedef sk_sp< SkImage >(* ImageMakerProc) (const SkImageInfo &, GrRecordingContext *, void(*)(SkCanvas *))

Definition at line 284 of file image.cpp.

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( scalepixels_unpremul  ,
canvas  ,
1080  ,
280   
)

Definition at line 443 of file image.cpp.

443 {
446 pm.alloc(info);
447 for (int y = 0; y < 16; ++y) {
448 for (int x = 0; x < 16; ++x) {
449 *pm.writable_addr32(x, y) = SkPackARGB32NoCheck(0, (y << 4) | y, (x << 4) | x, 0xFF);
450 }
451 }
454
455 for (auto s : gSamplings) {
456 pm.scalePixels(pm2, s);
457 slam_ff(pm2);
458 draw_pixmap(canvas, pm2, 10, 10);
459 canvas->translate(pm2.width() + 10.0f, 0);
460 }
461}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
kUnpremul_SkAlphaType
static SkPMColor SkPackARGB32NoCheck(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColorPriv.h:120
void alloc(const SkImageInfo &)
bool scalePixels(const SkPixmap &dst, const SkSamplingOptions &) const
int width() const
Definition: SkPixmap.h:160
uint32_t * writable_addr32(int x, int y) const
Definition: SkPixmap.h:537
struct MyStruct s
double y
double x
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)
static void draw_pixmap(SkCanvas *canvas, const SkPixmap &pmap)
Definition: image.cpp:200
const SkSamplingOptions gSamplings[]
Definition: image.cpp:57
static void slam_ff(const SkPixmap &pm)
Definition: image.cpp:435

◆ DEF_SIMPLE_GM_CAN_FAIL() [1/2]

DEF_SIMPLE_GM_CAN_FAIL ( image_subset  ,
canvas  ,
errorMsg  ,
440  ,
220   
)

Definition at line 502 of file image.cpp.

502 {
503 auto img = make_lazy_image();
504 if (!img) {
505 *errorMsg = "Failed to make lazy image.";
507 }
508
509 GrDirectContext* dContext = GrAsDirectContext(canvas->recordingContext());
510#if defined(SK_GRAPHITE)
511 auto recorder = canvas->recorder();
512#endif
513
514 canvas->drawImage(img, 10, 10);
515
516 sk_sp<SkImage> subset;
517
518#if defined(SK_GRAPHITE)
519 if (recorder) {
520 subset = img->makeSubset(recorder, {100, 100, 200, 200}, {});
521 } else
522#endif
523 {
524 subset = img->makeSubset(dContext, {100, 100, 200, 200});
525 }
526
527 canvas->drawImage(subset, 220, 10);
528 subset = serial_deserial(subset.get());
529 canvas->drawImage(subset, 220+110, 10);
531}
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
virtual sk_sp< SkImage > makeSubset(GrDirectContext *direct, const SkIRect &subset) const =0
T * get() const
Definition: SkRefCnt.h:303
static sk_sp< SkImage > serial_deserial(SkImage *img)
Definition: image.cpp:482
static sk_sp< SkImage > make_lazy_image()
Definition: image.cpp:465

◆ DEF_SIMPLE_GM_CAN_FAIL() [2/2]

DEF_SIMPLE_GM_CAN_FAIL ( new_texture_image  ,
canvas  ,
errorMsg  ,
280  ,
115   
)

Definition at line 319 of file image.cpp.

319 {
320
321 GrDirectContext* dContext = GrAsDirectContext(canvas->recordingContext());
322 bool isGPU = SkToBool(dContext);
323
324#if defined(SK_GRAPHITE)
325 skgpu::graphite::Recorder* recorder = canvas->recorder();
326 isGPU = isGPU || SkToBool(recorder);
327#endif
328
329 if (!isGPU) {
332 }
333
334 auto render_image = [](SkCanvas* canvas) {
335 canvas->clear(SK_ColorBLUE);
337 paint.setColor(SK_ColorRED);
338 canvas->drawRect(SkRect::MakeXYWH(10.f,10.f,10.f,10.f), paint);
339 paint.setColor(SK_ColorGREEN);
340 canvas->drawRect(SkRect::MakeXYWH(30.f,10.f,10.f,10.f), paint);
341 paint.setColor(SK_ColorYELLOW);
342 canvas->drawRect(SkRect::MakeXYWH(10.f,30.f,10.f,10.f), paint);
343 paint.setColor(SK_ColorCYAN);
344 canvas->drawRect(SkRect::MakeXYWH(30.f,30.f,10.f,10.f), paint);
345 };
346
347 static constexpr int kSize = 50;
351 SkBitmap bmp;
352 bmp.allocPixels(ii);
353 SkCanvas bmpCanvas(bmp);
354 render_image(&bmpCanvas);
355
356 std::function<sk_sp<SkImage>()> imageFactories[] = {
357 // Create sw raster image.
358 [&] { return bmp.asImage(); },
359 // Create encoded image.
360 [&] {
363 return SkImages::DeferredFromEncodedData(stream.detachAsData());
364 },
365 // Create YUV encoded image.
366 [&] {
369 return SkImages::DeferredFromEncodedData(stream.detachAsData());
370 },
371 // Create a picture image.
372 [&] {
373 SkPictureRecorder recorder;
374 SkCanvas* canvas =
376 render_image(canvas);
380 nullptr,
381 nullptr,
383 srgbColorSpace);
384 },
385 // Create a texture image
386 [&]() -> sk_sp<SkImage> {
388 if (dContext) {
390 } else {
391#if defined(SK_GRAPHITE)
392 surface = SkSurfaces::RenderTarget(recorder, ii);
393#endif
394 }
395
396 if (!surface) {
397 return nullptr;
398 }
399 render_image(surface->getCanvas());
400 return surface->makeImageSnapshot();
401 }};
402
403 constexpr SkScalar kPad = 5.f;
404 canvas->translate(kPad, kPad);
405 for (const auto& factory : imageFactories) {
406 sk_sp<SkImage> image(factory());
407 if (image) {
408 for (auto mm : { false, true }) {
409 sk_sp<SkImage> texImage;
410 if (dContext) {
411 texImage = SkImages::TextureFromImage(dContext,
412 image,
415 } else {
416#if defined(SK_GRAPHITE)
417 texImage = SkImages::TextureFromImage(recorder, image, {mm});
418#endif
419 }
420 if (texImage) {
421 canvas->drawImage(texImage, 0, mm ? kSize + kPad : 0);
422 }
423 }
424 }
425 canvas->translate(kSize + kPad, 0);
426 }
427
429}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
#define SkASSERT_RELEASE(cond)
Definition: SkAssert.h:100
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
constexpr SkColor SK_ColorYELLOW
Definition: SkColor.h:139
constexpr SkColor SK_ColorCYAN
Definition: SkColor.h:143
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
#define SkIntToScalar(x)
Definition: SkScalar.h:57
static constexpr bool SkToBool(const T &x)
Definition: SkTo.h:35
constexpr int kPad
void allocPixels(const SkImageInfo &info, size_t rowBytes)
Definition: SkBitmap.cpp:258
sk_sp< SkImage > asImage() const
Definition: SkBitmap.cpp:645
const SkPixmap & pixmap() const
Definition: SkBitmap.h:133
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
static sk_sp< SkColorSpace > MakeSRGB()
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
static constexpr char kErrorMsg_DrawSkippedGpuOnly[]
Definition: gm.h:127
const Paint & paint
Definition: color_source.cc:38
VkSurfaceKHR surface
Definition: main.cc:49
float SkScalar
Definition: extension.cpp:12
constexpr int kSize
SK_API sk_sp< SkImage > DeferredFromPicture(sk_sp< SkPicture > picture, const SkISize &dimensions, const SkMatrix *matrix, const SkPaint *paint, BitDepth bitDepth, sk_sp< SkColorSpace > colorSpace, SkSurfaceProps props)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API sk_sp< SkImage > TextureFromImage(GrDirectContext *, const SkImage *, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Budgeted=skgpu::Budgeted::kYes)
@ kU8
uses 8-bit unsigned int per color component
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659

◆ draw_contents() [1/2]

static void draw_contents ( SkCanvas canvas)
static

Definition at line 233 of file image.cpp.

233 {
236 paint.setStrokeWidth(20);
237 canvas->drawCircle(50, 50, 35, paint);
238}
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194

◆ draw_contents() [2/2]

static void draw_contents ( SkSurface surface,
SkColor  fillC 
)
static

Definition at line 64 of file image.cpp.

64 {
66 SkIntToScalar(surface->height()));
67 SkCanvas* canvas = surface->getCanvas();
68
69 SkScalar stroke = size.fWidth / 10;
70 SkScalar radius = (size.fWidth - stroke) / 2;
71
73
74 paint.setAntiAlias(true);
75 paint.setColor(fillC);
76 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint);
77
79 paint.setStrokeWidth(stroke);
80 paint.setColor(SK_ColorBLACK);
81 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint);
82}
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkSize.h:52
static constexpr SkSize Make(SkScalar w, SkScalar h)
Definition: SkSize.h:56

◆ draw_pixmap() [1/2]

static void draw_pixmap ( SkCanvas canvas,
const SkPixmap pm,
SkScalar  x,
SkScalar  y 
)
static

Definition at line 431 of file image.cpp.

431 {
433}
SK_API sk_sp< SkImage > RasterFromPixmapCopy(const SkPixmap &pixmap)

◆ draw_pixmap() [2/2]

static void draw_pixmap ( SkCanvas canvas,
const SkPixmap pmap 
)
static

Definition at line 200 of file image.cpp.

200 {
202 bitmap.installPixels(pmap);
203 canvas->drawImage(bitmap.asImage(), 0, 0);
204}
Definition: bitmap.py:1

◆ make_codec()

static sk_sp< SkImage > make_codec ( const SkImageInfo info,
GrRecordingContext ,
void(*)(SkCanvas *)  draw 
)
static

Definition at line 261 of file image.cpp.

263 {
266}
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
static sk_sp< SkImage > make_raster(const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
Definition: image.cpp:240

◆ make_gpu()

static sk_sp< SkImage > make_gpu ( const SkImageInfo info,
GrRecordingContext ctx,
void(*)(SkCanvas *)  draw 
)
static

Definition at line 268 of file image.cpp.

270 {
271 if (!ctx) {
272 return nullptr;
273 }
274
276 if (!surface) {
277 return nullptr;
278 }
279
280 draw(surface->getCanvas());
281 return surface->makeImageSnapshot();
282}

◆ make_lazy_image()

static sk_sp< SkImage > make_lazy_image ( )
static

Definition at line 465 of file image.cpp.

465 {
467 {
468 SkPictureRecorder recorder;
469 SkCanvas* canvas = recorder.beginRecording(SkRect::MakeIWH(200, 200));
470 canvas->drawCircle(100, 100, 100, SkPaint());
472 }
473
474 return SkImages::DeferredFromPicture(std::move(picture),
475 {200, 200},
476 /* matrix= */ nullptr,
477 /* paint= */ nullptr,
480}
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
static SkRect MakeIWH(int w, int h)
Definition: SkRect.h:623

◆ make_picture()

static sk_sp< SkImage > make_picture ( const SkImageInfo info,
GrRecordingContext ,
void(*)(SkCanvas *)  draw 
)
static

Definition at line 248 of file image.cpp.

250 {
251 SkPictureRecorder recorder;
252 draw(recorder.beginRecording(SkRect::MakeIWH(info.width(), info.height())));
254 info.dimensions(),
255 nullptr,
256 nullptr,
259}

◆ make_raster()

static sk_sp< SkImage > make_raster ( const SkImageInfo info,
GrRecordingContext ,
void(*)(SkCanvas *)  draw 
)
static

Definition at line 240 of file image.cpp.

242 {
244 draw(surface->getCanvas());
245 return surface->makeImageSnapshot();
246}
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)

◆ serial_deserial()

static sk_sp< SkImage > serial_deserial ( SkImage img)
static

Definition at line 482 of file image.cpp.

482 {
483 if (!img) {
484 return nullptr;
485 }
486
487 SkSerialProcs sProcs;
488 sProcs.fImageProc = [](SkImage* img, void*) -> sk_sp<SkData> {
489 return SkPngEncoder::Encode(as_IB(img)->directContext(), img, SkPngEncoder::Options{});
490 };
491 SkBinaryWriteBuffer writer(sProcs);
492
493 writer.writeImage(img);
494 size_t length = writer.bytesWritten();
496 writer.writeToMemory(data->writable_data());
497
498 SkReadBuffer reader(data->data(), length);
499 return reader.readImage();
500}
static SkImage_Base * as_IB(SkImage *image)
Definition: SkImage_Base.h:201
static sk_sp< SkData > MakeUninitialized(size_t length)
Definition: SkData.cpp:116
size_t length
SkSerialImageProc fImageProc
Definition: SkSerialProcs.h:90
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ show_scaled_pixels()

static void show_scaled_pixels ( SkCanvas canvas,
SkImage image 
)
static

Definition at line 206 of file image.cpp.

206 {
207 SkAutoCanvasRestore acr(canvas, true);
208
209 canvas->drawImage(image, 0, 0);
210 canvas->translate(110, 10);
211
213 SkAutoPixmapStorage storage;
214 storage.alloc(info);
215
216 const SkImage::CachingHint chints[] = {
218 };
219
220 for (auto ch : chints) {
221 canvas->save();
222 for (auto s : gSamplings) {
223 if (image->scalePixels(storage, s, ch)) {
224 draw_pixmap(canvas, storage);
225 }
226 canvas->translate(70, 0);
227 }
228 canvas->restore();
229 canvas->translate(0, 45);
230 }
231}
void restore()
Definition: SkCanvas.cpp:461
int save()
Definition: SkCanvas.cpp:447
CachingHint
Definition: SkImage.h:463
@ kDisallow_CachingHint
disallows internally caching decoded and copied pixels
Definition: SkImage.h:465
@ kAllow_CachingHint
allows internally caching decoded and copied pixels
Definition: SkImage.h:464
bool scalePixels(const SkPixmap &dst, const SkSamplingOptions &, CachingHint cachingHint=kAllow_CachingHint) const
Definition: SkImage.cpp:127
static SkImageInfo MakeN32Premul(int width, int height)

◆ slam_ff()

static void slam_ff ( const SkPixmap pm)
static

Definition at line 435 of file image.cpp.

435 {
436 for (int y = 0; y < pm.height(); ++y) {
437 for (int x = 0; x < pm.width(); ++x) {
438 *pm.writable_addr32(x, y) = *pm.addr32(x, y) | SkPackARGB32(0xFF, 0, 0, 0);
439 }
440 }
441}
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColorPriv.h:106
const uint32_t * addr32() const
Definition: SkPixmap.h:352
int height() const
Definition: SkPixmap.h:166

◆ test_surface()

static void test_surface ( SkCanvas canvas,
SkSurface surf,
bool  usePaint 
)
static

Definition at line 84 of file image.cpp.

84 {
86 sk_sp<SkImage> imgR = surf->makeImageSnapshot();
87
88 if (true) {
89 sk_sp<SkImage> imgR2 = surf->makeImageSnapshot();
90 SkASSERT(imgR == imgR2);
91 }
92
93 imgR = ToolUtils::MakeTextureImage(canvas, std::move(imgR));
96
97 // since we've drawn after we snapped imgR, imgG will be a different obj unless the
98 // gpu context has been abandoned (in which case they will both be null)
99 SkASSERT(imgR != imgG || (!imgR && !imgG));
100
102
105
106 canvas->drawImage(imgR, 0, 0, sampling, usePaint ? &paint : nullptr);
107 canvas->drawImage(imgG, 0, 80, sampling, usePaint ? &paint : nullptr);
108 surf->draw(canvas, 0, 160, SkSamplingOptions(), usePaint ? &paint : nullptr);
109
110 SkRect src1, src2, src3;
111 src1.setIWH(surf->width(), surf->height());
112 src2.setLTRB(SkIntToScalar(-surf->width() / 2), SkIntToScalar(-surf->height() / 2),
113 SkIntToScalar(surf->width()), SkIntToScalar(surf->height()));
114 src3.setIWH(surf->width() / 2, surf->height() / 2);
115
116 SkRect dst1, dst2, dst3, dst4;
117 dst1.setLTRB(0, 240, 65, 305);
118 dst2.setLTRB(0, 320, 65, 385);
119 dst3.setLTRB(0, 400, 65, 465);
120 dst4.setLTRB(0, 480, 65, 545);
121
122 canvas->drawImageRect(imgR, src1, dst1, sampling, usePaint ? &paint : nullptr,
124 canvas->drawImageRect(imgG, src2, dst2, sampling, usePaint ? &paint : nullptr,
126 canvas->drawImageRect(imgR, src3, dst3, sampling, usePaint ? &paint : nullptr,
128 canvas->drawImageRect(imgG, dst4, sampling, usePaint ? &paint : nullptr);
129}
#define SkASSERT(cond)
Definition: SkAssert.h:116
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
Definition: SkCanvas.h:1542
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
Definition: SkCanvas.cpp:2333
int width() const
Definition: SkSurface.h:178
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
int height() const
Definition: SkSurface.h:184
SkSamplingOptions sampling
Definition: SkRecords.h:337
sk_sp< SkImage > MakeTextureImage(SkCanvas *canvas, sk_sp< SkImage > orig)
SkSamplingOptions(SkFilterMode::kLinear))
void setIWH(int32_t width, int32_t height)
Definition: SkRect.h:950
void setLTRB(float left, float top, float right, float bottom)
Definition: SkRect.h:865
static void draw_contents(SkSurface *surface, SkColor fillC)
Definition: image.cpp:64

Variable Documentation

◆ gSamplings

const SkSamplingOptions gSamplings[]