Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Image_AdoptTextureFrom.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Image_AdoptTextureFrom, 256, 256, false, 5)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Image_AdoptTextureFrom  ,
256  ,
256  ,
false  ,
 
)

Definition at line 5 of file Image_AdoptTextureFrom.cpp.

5 {
6void draw(SkCanvas* canvas) {
8 // Example does not support DDL.
9 if (!dContext) {
10 return;
11 }
12 canvas->scale(.5f, .5f);
13 canvas->clear(0x7f3f5f7f);
14 int x = 0, y = 0;
18 dContext, backEndTexture, origin, kRGBA_8888_SkColorType, alpha);
19 canvas->drawImage(image, x, y);
20 x += 160;
21 }
22 x -= 160 * 3;
23 y += 256;
24 }
25}
26} // END FIDDLE
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kBottomLeft_GrSurfaceOrigin
Definition GrTypes.h:149
@ kTopLeft_GrSurfaceOrigin
Definition GrTypes.h:148
kUnpremul_SkAlphaType
@ kOpaque_SkAlphaType
pixel is opaque
Definition SkAlphaType.h:28
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
virtual GrRecordingContext * recordingContext() const
void clear(SkColor color)
Definition SkCanvas.h:1199
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
sk_sp< SkImage > image
Definition examples.cpp:29
GrBackendTexture backEndTexture
Definition examples.cpp:25
double y
double x
SK_API sk_sp< SkImage > AdoptTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin textureOrigin, SkColorType colorType)