12 if (
nullptr ==
image) {
17 paint.setAntiAlias(
true);
21 const char* msg =
image->
isValid(dContext) ?
"is valid on GPU"
26 const char* msg =
image->
isValid(
nullptr) ?
"is valid on CPU" :
"not valid on CPU";
37 drawImage(
image,
"image");
39 drawImage(bitmapImage,
"source");
41 drawImage(textureImage,
"backEndTexture");
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kTopLeft_GrSurfaceOrigin
REG_FIDDLE(Image_isValid, 256, 256, false, 5)
@ kOpaque_SkAlphaType
pixel is opaque
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
sk_sp< SkImage > asImage() const
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
virtual bool isValid(GrRecordingContext *context) const =0
sk_sp< SkFontMgr > fontMgr
GrBackendTexture backEndTexture
SK_API sk_sp< SkImage > BorrowTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
sk_sp< const SkImage > image
font
Font Metadata and Metrics.