Flutter Engine
The Flutter Engine
|
#include <SkImage_GaneshBase.h>
Static Public Member Functions | |
static bool | ValidateBackendTexture (const GrCaps *, const GrBackendTexture &tex, GrColorType grCT, SkColorType ct, SkAlphaType at, sk_sp< SkColorSpace > cs) |
static bool | ValidateCompressedBackendTexture (const GrCaps *, const GrBackendTexture &tex, SkAlphaType) |
static sk_sp< GrTextureProxy > | MakePromiseImageLazyProxy (GrContextThreadSafeProxy *, SkISize dimensions, const GrBackendFormat &, skgpu::Mipmapped, SkImages::PromiseImageTextureFulfillProc, sk_sp< skgpu::RefCntedCallback > releaseHelper) |
Protected Member Functions | |
SkImage_GaneshBase (sk_sp< GrImageContext >, SkImageInfo, uint32_t uniqueID) | |
sk_sp< SkImage > | onMakeSubset (skgpu::graphite::Recorder *, const SkIRect &subset, RequiredProperties) const final |
sk_sp< SkImage > | makeColorTypeAndColorSpace (skgpu::graphite::Recorder *, SkColorType, sk_sp< SkColorSpace >, RequiredProperties) const final |
virtual sk_sp< SkImage > | onMakeColorTypeAndColorSpace (SkColorType, sk_sp< SkColorSpace >, GrDirectContext *) const=0 |
Protected Member Functions inherited from SkImage_Base | |
SkImage_Base (const SkImageInfo &info, uint32_t uniqueID) | |
Protected Attributes | |
sk_sp< GrImageContext > | fContext |
Additional Inherited Members | |
Public Types inherited from SkImage_Base | |
enum class | Type { kRaster , kRasterPinnable , kLazy , kLazyPicture , kGanesh , kGaneshYUVA , kGraphite , kGraphiteYUVA } |
Public Types inherited from SkImage | |
enum | CachingHint { kAllow_CachingHint , kDisallow_CachingHint } |
enum class | RescaleGamma : bool { kSrc , kLinear } |
enum class | RescaleMode { kNearest , kLinear , kRepeatedLinear , kRepeatedCubic } |
enum | LegacyBitmapMode { kRO_LegacyBitmapMode } |
using | ReadPixelsContext = void * |
using | ReadPixelsCallback = void(ReadPixelsContext, std::unique_ptr< const AsyncReadResult >) |
Definition at line 54 of file SkImage_GaneshBase.h.
|
protected |
Definition at line 61 of file SkImage_GaneshBase.cpp.
|
pure virtual |
Implemented in SkImage_Ganesh, and SkImage_GaneshYUVA.
|
pure virtual |
Implemented in SkImage_Ganesh, and SkImage_GaneshYUVA.
|
inlinefinalvirtual |
|
inlinefinalvirtual |
this->context() try-casted to GrDirectContext. Useful for migrations – avoid otherwise!
Reimplemented from SkImage_Base.
Definition at line 65 of file SkImage_GaneshBase.h.
|
pure virtual |
Implemented in SkImage_Ganesh, and SkImage_GaneshYUVA.
|
finalvirtual |
Implements SkImage_Base.
Definition at line 118 of file SkImage_GaneshBase.cpp.
|
finalvirtual |
Returns true if SkImage can be drawn on either raster surface or GPU surface. If context is nullptr, tests if SkImage draws on raster surface; otherwise, tests if SkImage draws on GPU surface associated with context.
SkImage backed by GPU texture may become invalid if associated context is invalid. lazy image may be invalid and may not draw to raster surface or GPU surface or both.
context | GPU context |
example: https://fiddle.skia.org/c/@Image_isValid
Implements SkImage.
Definition at line 257 of file SkImage_GaneshBase.cpp.
|
finalvirtual |
Experimental. Creates SkImage in target SkColorType and SkColorSpace. Returns nullptr if SkImage could not be created.
Returns original SkImage if it is in target SkColorType and SkColorSpace.
If this image is texture-backed, the context parameter is required and must match the context of the source image.
direct | The GrDirectContext in play, if it exists |
targetColorType | SkColorType of returned SkImage |
targetColorSpace | SkColorSpace of returned SkImage |
Implements SkImage.
Definition at line 270 of file SkImage_GaneshBase.cpp.
|
finalprotectedvirtual |
Experimental. Creates SkImage in target SkColorType and SkColorSpace. Returns nullptr if SkImage could not be created.
Returns original SkImage if it is in target SkColorType and SkColorSpace.
If this image is graphite-backed, the recorder parameter is required.
targetColorType | SkColorType of returned SkImage |
targetColorSpace | SkColorSpace of returned SkImage |
recorder | The Recorder in which to create the new image |
RequiredProperties | properties the returned SkImage must possess (e.g. mipmaps) |
Implements SkImage.
Definition at line 225 of file SkImage_GaneshBase.cpp.
|
static |
This class is the lazy instantiation callback for promise images. It manages calling the client's Fulfill and Release procs. It attempts to reuse a GrTexture instance in cases where the client provides the same GrPromiseImageTexture as Fulfill results for multiple SkImages. The created GrTexture is given a key based on a unique ID associated with the GrPromiseImageTexture.
A key invalidation message is installed on the GrPromiseImageTexture so that the GrTexture is deleted once it can no longer be used to instantiate a proxy.
Definition at line 296 of file SkImage_GaneshBase.cpp.
|
finalvirtual |
Returns subset of this image.
Returns nullptr if any of the following are true:
If the source image was texture-backed, the resulting image will be texture-backed also. Otherwise, the returned image will be raster-backed.
direct | the GrDirectContext of the source image (nullptr is ok if the source image is not texture-backed). |
subset | bounds of returned SkImage |
example: https://fiddle.skia.org/c/@Image_makeSubset
Implements SkImage.
Definition at line 167 of file SkImage_GaneshBase.cpp.
|
protectedvirtual |
Implements SkImage_Base.
Reimplemented in SkImage_GaneshYUVA.
|
finalvirtual |
Implements SkImage_Base.
Definition at line 190 of file SkImage_GaneshBase.cpp.
|
finalprotectedvirtual |
Implements SkImage_Base.
Definition at line 218 of file SkImage_GaneshBase.cpp.
|
overridevirtual |
Implements SkImage_Base.
Definition at line 233 of file SkImage_GaneshBase.cpp.
|
pure virtual |
Implemented in SkImage_Ganesh, and SkImage_GaneshYUVA.
|
static |
Definition at line 68 of file SkImage_GaneshBase.cpp.
|
static |
Definition at line 89 of file SkImage_GaneshBase.cpp.
|
protected |
Definition at line 127 of file SkImage_GaneshBase.h.