4 {
8
10 if (!dContext) {
11 return;
12 }
13
18 auto surfaceCanvas = gpuSurface->getCanvas();
20 surfaceCanvas->drawString(
"GPU rocks!", 20, 40,
font,
paint);
24 }
25}
26}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
@ kOpaque_SkAlphaType
pixel is opaque
constexpr SkColor SK_ColorWHITE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
sk_sp< SkFontMgr > fontMgr
sk_sp< const SkImage > image
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)
font
Font Metadata and Metrics.
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)