Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Image_DeferredFromEncodedData.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.
4// HASH=894f732ed6409b1f392bc5481421d0e9
5REG_FIDDLE(Image_DeferredFromEncodedData, 256, 256, false, 3) {
6 void draw(SkCanvas * canvas) {
7 int x = 0;
8 for (int quality : {100, 50, 10, 1}) {
10 options.fQuality = quality;
13 canvas->drawImage(image, x, 0);
14 x += 64;
15 }
16 }
17} // END FIDDLE
const char * options
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
T * get() const
Definition SkRefCnt.h:303
sk_sp< SkImage > image
Definition examples.cpp:29
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
double x
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)