4REG_FIDDLE(Image_MakeBackendTextureFromImage, 256, 64,
false, 0) {
13 return surface->makeImageSnapshot();
26 dContext, std::move(backEndImage), &
texture, &proc)) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kTopLeft_GrSurfaceOrigin
static sk_sp< SkImage > create_gpu_image(GrRecordingContext *rContext, bool withMips=false, skgpu::Budgeted budgeted=skgpu::Budgeted::kYes)
REG_FIDDLE(Image_MakeBackendTextureFromImage, 256, 64, false, 0)
@ kOpaque_SkAlphaType
pixel is opaque
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void drawRect(const SkRect &rect, const SkPaint &paint)
virtual GrRecordingContext * recordingContext() const
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
std::function< void(GrBackendTexture)> BackendTextureReleaseProc
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_API bool MakeBackendTextureFromImage(GrDirectContext *context, sk_sp< SkImage > image, GrBackendTexture *backendTexture, BackendTextureReleaseProc *backendTextureReleaseProc)
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 SkImageInfo MakeN32(int width, int height, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)