77#if defined(SK_USE_LEGACY_BLUR_GANESH)
93 std::string_view label) {
119 "TextureForImageRasterWithPolicyEqualKDraw",
191 std::tie(views[
i], std::ignore) =
206 "ImageLazy_TextureProxyViewFromPlanes",
237 sfc->fillWithFP(std::move(
fp));
239 return sfc->readSurfaceView();
290 enum LockTexturePath {
291 kFailure_LockTexturePath,
292 kPreExisting_LockTexturePath,
293 kNative_LockTexturePath,
294 kCompressed_LockTexturePath,
295 kYUV_LockTexturePath,
296 kRGBA_LockTexturePath,
299 enum { kLockTexturePathCount = kRGBA_LockTexturePath + 1 };
310 SkASSERT(view && view.asTextureProxy());
342 installKey(mippedView);
361 auto textureGen =
static_cast<GrTextureGenerator*
>(sharedGenerator->fGenerator.get());
362 if (
auto view = textureGen->generateTexture(rContext,
390 : SkImage::CachingHint::kDisallow_CachingHint;
438 }
else if (ib->isGaneshBacked()) {
441 }
else if (ib->isLazyGenerated()) {
445 SkDEBUGFAIL(
"Unsupported image type to make a View");
513 std::move(view), at,
m, sampler, *subset, *domain, caps);
559 if (ib->isRasterBacked()) {
567 }
else if (ib->isGaneshBacked()) {
570 }
else if (ib->isLazyGenerated()) {
584 SkDEBUGFAIL(
"Unsupported image type to make a FragmentProcessor");
673 uint32_t imageUniqueID) {
694 return {std::move(cachedMippedView), view.
origin(), view.
swizzle()};
710 const auto isValid = [&context](
DataType dt,
int n) {
714 for (
int n = 1; n <= 4; ++n) {
739#if defined(SK_USE_LEGACY_BLUR_GANESH)
763 std::move(colorSpace));
772 props ? *props : this->surfaceProps(),
784 auto threadSafeCache =
fContext->priv().threadSafeCache();
790 auto view = threadSafeCache->find(
key);
796 threadSafeCache->add(
key, view);
799 return sk_make_sp<SkImage_Ganesh>(
fContext,
800 data.getGenerationID(),
802 data.info().colorInfo());
805 const SkBlurEngine* getBlurEngine()
const override {
return this; }
814#if defined(SK_USE_LEGACY_BLUR_GANESH)
828 float maxSigma()
const override {
833 bool supportsOnlyDecalTiling()
const override {
return false; }
839 const SkIRect& dstRect)
const override {
841 if (!inputView.
proxy()) {
850 std::move(inputView),
866 sdc->readSurfaceView(),
868 this->surfaceProps());
871 bool useLegacyFilterResultBlur()
const override {
return false; }
882 this->surfaceProps(),
900 return sk_make_sp<GaneshBackend>(std::move(context), origin, surfaceProps,
colorType);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
@ kTopLeft_GrSurfaceOrigin
static sk_sp< Effect > Create()
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SkDEBUGFAIL(message)
GrSurfaceProxyView GrCopyBaseMipMapToView(GrRecordingContext *context, GrSurfaceProxyView src, skgpu::Budgeted budgeted)
void GrMakeKeyFromImageID(skgpu::UniqueKey *key, uint32_t imageID, const SkIRect &imageBounds)
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeUncachedBitmapProxyView(GrRecordingContext *rContext, const SkBitmap &bitmap, skgpu::Mipmapped mipmapped, SkBackingFit fit, skgpu::Budgeted budgeted)
sk_sp< SkIDChangeListener > GrMakeUniqueKeyInvalidationListener(skgpu::UniqueKey *key, uint32_t contextID)
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeCachedBitmapProxyView(GrRecordingContext *rContext, const SkBitmap &bitmap, std::string_view label, skgpu::Mipmapped mipmapped)
@ kNew_Uncached_Unbudgeted
static constexpr GrSamplerState::WrapMode SkTileModeToWrapMode(SkTileMode tileMode)
static bool GrValidCubicResampler(SkCubicResampler cubic)
static void releaseProc(const void *ptr, void *context)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
sk_sp< T > sk_ref_sp(T *obj)
#define SK_ScalarInfinity
@ kNeedNewImageUniqueID_SpecialImage
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
static constexpr uint32_t SK_InvalidUniqueID
const GrContextOptions & options() const
uint32_t contextID() const
const GrCaps * caps() const
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView view, SkAlphaType, const SkMatrix &, SkCubicResampler, Direction)
static std::unique_ptr< GrFragmentProcessor > MakeSubset(GrSurfaceProxyView view, SkAlphaType, const SkMatrix &, const GrSamplerState::WrapMode wrapX, const GrSamplerState::WrapMode wrapY, const SkRect &subset, SkCubicResampler, Direction, const GrCaps &)
bool mipmapSupport() const
bool anisoSupport() const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
skgpu::Swizzle getReadSwizzle(const GrBackendFormat &format, GrColorType colorType) const
SK_API GrBackendFormat defaultBackendFormat(SkColorType, GrRenderable) const
void removeUniqueKeyFromProxy(GrTextureProxy *)
bool assignUniqueKeyToProxy(const skgpu::UniqueKey &, GrTextureProxy *)
sk_sp< GrTextureProxy > findOrCreateProxyByUniqueKey(const skgpu::UniqueKey &, UseAllocator=UseAllocator::kYes)
GrProxyProvider * proxyProvider()
std::unique_ptr< skgpu::ganesh::SurfaceFillContext > makeSFC(GrImageInfo, std::string_view label, SkBackingFit=SkBackingFit::kExact, int sampleCount=1, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Protected=skgpu::Protected::kNo, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
GrRecordingContextPriv priv()
static constexpr GrSamplerState Aniso(WrapMode wrapX, WrapMode wrapY, int maxAniso, skgpu::Mipmapped viewIsMipped)
skgpu::Swizzle swizzle() const
skgpu::Mipmapped mipmapped() const
GrTextureProxy * asTextureProxy() const
SkISize dimensions() const
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy() const
static GrSurfaceProxyView Copy(GrRecordingContext *context, GrSurfaceProxyView src, skgpu::Mipmapped mipmapped, SkIRect srcRect, SkBackingFit fit, skgpu::Budgeted budgeted, std::string_view label)
virtual GrTextureProxy * asTextureProxy()
static std::unique_ptr< GrFragmentProcessor > MakeSubset(GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState, const SkRect &subset, const GrCaps &caps, const float border[4]=kDefaultBorder, bool alwaysUseShaderTileMode=false)
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView, SkAlphaType, const SkMatrix &=SkMatrix::I(), GrSamplerState::Filter=GrSamplerState::Filter::kNearest, GrSamplerState::MipmapMode mipmapMode=GrSamplerState::MipmapMode::kNone)
skgpu::Mipmapped mipmapped() const
static std::unique_ptr< GrFragmentProcessor > Make(const GrYUVATextureProxies &yuvaProxies, GrSamplerState samplerState, const GrCaps &, const SkMatrix &localMatrix=SkMatrix::I(), const SkRect *subset=nullptr, const SkRect *domain=nullptr)
const SkImageInfo & getInfo() const
std::unique_ptr< SkImageGenerator > fGenerator
bool isTextureGenerator()
virtual std::tuple< GrSurfaceProxyView, GrColorType > asView(GrRecordingContext *, skgpu::Mipmapped, GrImageTexGenPolicy) const =0
virtual std::unique_ptr< GrFragmentProcessor > asFragmentProcessor(GrRecordingContext *, SkSamplingOptions, const SkTileMode[2], const SkMatrix &, const SkRect *, const SkRect *) const =0
bool getROPixels(GrDirectContext *, SkBitmap *, CachingHint) const override
void addUniqueIDListener(sk_sp< SkIDChangeListener >) const
sk_sp< SharedGenerator > generator() const
SkImage_Base::Type type() const override
sk_sp< SkCachedData > getPlanes(const SkYUVAPixmapInfo::SupportedDataTypes &supportedDataTypes, SkYUVAPixmaps *pixmaps) const
const SkSurfaceProps * props() const
void replay(SkCanvas *) const
std::tuple< GrSurfaceProxyView, GrColorType > asView(GrRecordingContext *, skgpu::Mipmapped, GrImageTexGenPolicy) const
const SkImageInfo & imageInfo() const
SkColorSpace * colorSpace() const
SkISize dimensions() const
uint32_t uniqueID() const
SkAlphaType alphaType() const
SkColorType colorType() const
const SkImageInfo & info() const
void * writable_addr() const
SkISize dimensions() const
static SkSamplingOptions AnisoFallback(bool imageIsMipped)
SkAlphaType alphaType() const
SkColorSpace * getColorSpace() const
const SkIRect & subset() const
SkColorType colorType() const
static constexpr int kMaxPlanes
void enableDataType(DataType, int numChannels)
@ kUnorm10_Unorm2
10 bit unorm for Y, U, and V. 2 bit unorm for alpha (if present).
@ kUnorm8
8 bit unsigned normalized
@ kUnorm16
16 bit unsigned normalized
@ kFloat16
16 bit (half) floating point
static constexpr SkColorType DefaultColorTypeForDataType(DataType dataType, int numChannels)
const SkYUVAInfo & yuvaInfo() const
const SkPixmap & plane(int i) const
static Domain GenerateDomain()
uint32_t uint32_t * format
std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > GaussianBlur(GrRecordingContext *rContext, GrSurfaceProxyView srcView, GrColorType srcColorType, SkAlphaType srcAlphaType, sk_sp< SkColorSpace > colorSpace, SkIRect dstBounds, SkIRect srcBounds, float sigmaX, float sigmaY, SkTileMode mode, SkBackingFit fit)
sk_sp< const SkImage > image
SkSamplingOptions sampling
GrSurfaceProxyView AsView(GrRecordingContext *context, const SkSpecialImage *img)
sk_sp< SkSpecialImage > MakeFromTextureImage(GrRecordingContext *rContext, const SkIRect &subset, sk_sp< SkImage > image, const SkSurfaceProps &props)
sk_sp< SkSpecialImage > MakeDeferredFromGpu(GrRecordingContext *context, const SkIRect &subset, uint32_t uniqueID, GrSurfaceProxyView view, const GrColorInfo &colorInfo, const SkSurfaceProps &props)
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)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network policy
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
const myers::Point & get< 0 >(const myers::Segment &s)
std::unique_ptr< GrFragmentProcessor > AsFragmentProcessor(GrRecordingContext *rContext, const SkImage *img, SkSamplingOptions sampling, const SkTileMode tileModes[2], const SkMatrix &m, const SkRect *subset, const SkRect *domain)
std::tuple< GrSurfaceProxyView, GrColorType > RasterAsView(GrRecordingContext *rContext, const SkImage_Raster *raster, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy policy)
static std::unique_ptr< GrFragmentProcessor > make_fp_from_view(GrRecordingContext *rContext, GrSurfaceProxyView view, SkAlphaType at, SkSamplingOptions sampling, const SkTileMode tileModes[2], const SkMatrix &m, const SkRect *subset, const SkRect *domain)
GrColorType ColorTypeOfLockTextureProxy(const GrCaps *caps, SkColorType sct)
GrSurfaceProxyView FindOrMakeCachedMipmappedView(GrRecordingContext *rContext, GrSurfaceProxyView view, uint32_t imageUniqueID)
static GrSurfaceOrigin get_origin(const SkImage_Lazy *img)
GrSurfaceProxyView LockTextureProxyView(GrRecordingContext *rContext, const SkImage_Lazy *img, GrImageTexGenPolicy texGenPolicy, skgpu::Mipmapped mipmapped)
std::unique_ptr< GrFragmentProcessor > raster_as_fp(GrRecordingContext *rContext, const SkImage_Raster *img, SkSamplingOptions sampling, const SkTileMode tileModes[2], const SkMatrix &m, const SkRect *subset, const SkRect *domain)
GrSurfaceProxyView CopyView(GrRecordingContext *context, GrSurfaceProxyView src, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy policy, std::string_view label)
std::tuple< GrSurfaceProxyView, GrColorType > AsView(GrRecordingContext *rContext, const SkImage *img, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy policy)
static GrSurfaceProxyView texture_proxy_view_from_planes(GrRecordingContext *ctx, const SkImage_Lazy *img, skgpu::Budgeted budgeted)
static std::tuple< GrSurfaceProxyView, GrColorType > lazy_as_view(GrRecordingContext *context, const SkImage_Lazy *img, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy policy)
std::unique_ptr< GrFragmentProcessor > MakeFragmentProcessorFromView(GrRecordingContext *rContext, GrSurfaceProxyView view, SkAlphaType at, SkSamplingOptions sampling, const SkTileMode tileModes[2], const SkMatrix &m, const SkRect *subset, const SkRect *domain)
SkYUVAPixmapInfo::SupportedDataTypes SupportedTextureFormats(const GrImageContext &context)
static GrSurfaceProxyView generate_picture_texture(GrRecordingContext *ctx, const SkImage_Picture *img, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy texGenPolicy)
SkSamplingOptions(SkFilterMode::kLinear))
sk_sp< Backend > MakeGaneshBackend(sk_sp< GrRecordingContext > context, GrSurfaceOrigin origin, const SkSurfaceProps &surfaceProps, SkColorType colorType)
bool fDisableGpuYUVConversion
constexpr SkISize size() const
static constexpr SkIRect MakeSize(const SkISize &size)
constexpr SkIRect makeOffset(int32_t dx, int32_t dy) const
constexpr SkIPoint topLeft() const
static constexpr SkIRect MakePtSize(SkIPoint pt, SkISize size)
constexpr int64_t area() const
SkColorSpace * colorSpace() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
const SkCubicResampler cubic
const SkFilterMode filter
const SkMipmapMode mipmap
std::shared_ptr< const fml::Mapping > data