76 static const size_t kCacheSize = 1000000;
101 static const size_t kCacheSize = 1000000;
127 const size_t kCacheSize =
image->getSize() + 10;
143 cache->set(key2, filter2.get(),
154 static const size_t kCacheSize = 1000000;
164 cache->set(key1, filter1.get(),
166 cache->set(key2, filter2.get(),
174 cache->purgeByImageFilter(filter1.get());
251 auto dContext = ctxInfo.directContext();
254 if (!srcView.
proxy()) {
281 srcImage, &readBackBackendTex,
false, &readBackOrigin);
283 if (!GrBackendTexture::TestingOnly_Equals(readBackBackendTex, backendTex)) {
288 if (readBackOrigin != texOrigin) {
289 ERRORF(
reporter,
"origin mismatch %d %d\n", readBackOrigin, texOrigin);
300 auto dContext = ctxInfo.directContext();
303 if (!srcView.
proxy()) {
@ kTopLeft_GrSurfaceOrigin
static const int kFullSize
static const int kSmallerSize
static void test_explicit_purging(skiatest::Reporter *reporter, const sk_sp< SkSpecialImage > &image, const sk_sp< SkSpecialImage > &subset)
static void test_dont_find_if_diff_key(skiatest::Reporter *reporter, const sk_sp< SkSpecialImage > &image, const sk_sp< SkSpecialImage > &subset)
static SkBitmap create_bm()
static void test_image_backed(skiatest::Reporter *reporter, GrRecordingContext *rContext, const sk_sp< SkImage > &srcImage)
static void test_internal_purge(skiatest::Reporter *reporter, const sk_sp< SkSpecialImage > &image)
static GrSurfaceProxyView create_proxy_view(GrRecordingContext *rContext)
static sk_sp< SkImageFilter > make_filter()
static void test_find_existing(skiatest::Reporter *reporter, const sk_sp< SkSpecialImage > &image, const sk_sp< SkSpecialImage > &subset)
DEF_SERIAL_TEST(PurgeImageFilterCache, r)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_ImageBackedGPU, reporter, ctxInfo, CtsEnforcement::kNever)
DEF_TEST(ImageFilterCache_RasterBacked, reporter)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLUE
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeUncachedBitmapProxyView(GrRecordingContext *rContext, const SkBitmap &bitmap, skgpu::Mipmapped mipmapped, SkBackingFit fit, skgpu::Budgeted budgeted)
static bool ok(int result)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
@ kNeedNewImageUniqueID_SpecialImage
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
#define REPORTER_ASSERT(r, cond,...)
GrSurfaceProxy * proxy() const
virtual bool instantiate(GrResourceProvider *)=0
GrTexture * peekTexture() const
virtual GrBackendTexture getBackendTexture() const =0
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
void eraseColor(SkColor4f) const
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static void PurgeResourceCache()
static sk_sp< SkImageFilterCache > Get(CreateIfNecessary=CreateIfNecessary::kYes)
static sk_sp< SkImageFilterCache > Create(size_t maxBytes)
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
uint32_t uniqueID() const
static SkMatrix Translate(SkScalar dx, SkScalar dy)
static const SkMatrix & I()
uint32_t uniqueID() const
const SkIRect & subset() const
LayerSpace< SkIRect > layerBounds() const
SK_API bool GetBackendTextureFromImage(const SkImage *img, GrBackendTexture *outTexture, bool flushPendingGrContextIO, GrSurfaceOrigin *origin=nullptr)
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
sk_sp< SkSpecialImage > MakeFromRaster(const SkIRect &subset, const SkBitmap &bm, const SkSurfaceProps &props)
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)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
const myers::Point & get< 0 >(const myers::Segment &s)
static constexpr SkIPoint Make(int32_t x, int32_t y)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)