Image filters: de-nest SkImageFilter::Cache and Cache::Key.
This reduces the public header, and also allows us to foward-
declare them, so we can remove an #include from all the
SkDevice subclass headers.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1919063002
Review-Url: https://codereview.chromium.org/1919063002
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index 58d279c..a7240dc 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -10,7 +10,7 @@
#include "SkBitmap.h"
#include "SkImage.h"
#include "SkImageFilter.h"
-#include "SkImageFilterCacheKey.h"
+#include "SkImageFilterCache.h"
#include "SkMatrix.h"
#include "SkSpecialImage.h"
@@ -30,11 +30,11 @@
const sk_sp<SkSpecialImage>& image,
const sk_sp<SkSpecialImage>& subset) {
static const size_t kCacheSize = 1000000;
- SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kCacheSize));
+ SkAutoTUnref<SkImageFilterCache> cache(SkImageFilterCache::Create(kCacheSize));
SkIRect clip = SkIRect::MakeWH(100, 100);
- SkImageFilter::Cache::Key key1(0, SkMatrix::I(), clip, image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key2(0, SkMatrix::I(), clip, subset->uniqueID(), subset->subset());
+ SkImageFilterCacheKey key1(0, SkMatrix::I(), clip, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key2(0, SkMatrix::I(), clip, subset->uniqueID(), subset->subset());
SkIPoint offset = SkIPoint::Make(3, 4);
cache->set(key1, image.get(), offset);
@@ -54,16 +54,16 @@
const sk_sp<SkSpecialImage>& image,
const sk_sp<SkSpecialImage>& subset) {
static const size_t kCacheSize = 1000000;
- SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kCacheSize));
+ SkAutoTUnref<SkImageFilterCache> cache(SkImageFilterCache::Create(kCacheSize));
SkIRect clip1 = SkIRect::MakeWH(100, 100);
SkIRect clip2 = SkIRect::MakeWH(200, 200);
- SkImageFilter::Cache::Key key0(0, SkMatrix::I(), clip1, image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key1(1, SkMatrix::I(), clip1, image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key2(0, SkMatrix::MakeTrans(5, 5), clip1,
+ SkImageFilterCacheKey key0(0, SkMatrix::I(), clip1, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key1(1, SkMatrix::I(), clip1, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key2(0, SkMatrix::MakeTrans(5, 5), clip1,
image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key3(0, SkMatrix::I(), clip2, image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key4(0, SkMatrix::I(), clip1, subset->uniqueID(), subset->subset());
+ SkImageFilterCacheKey key3(0, SkMatrix::I(), clip2, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key4(0, SkMatrix::I(), clip1, subset->uniqueID(), subset->subset());
SkIPoint offset = SkIPoint::Make(3, 4);
cache->set(key0, image.get(), offset);
@@ -79,11 +79,11 @@
static void test_internal_purge(skiatest::Reporter* reporter, const sk_sp<SkSpecialImage>& image) {
SkASSERT(image->getSize());
const size_t kCacheSize = image->getSize() + 10;
- SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kCacheSize));
+ SkAutoTUnref<SkImageFilterCache> cache(SkImageFilterCache::Create(kCacheSize));
SkIRect clip = SkIRect::MakeWH(100, 100);
- SkImageFilter::Cache::Key key1(0, SkMatrix::I(), clip, image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key2(1, SkMatrix::I(), clip, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key1(0, SkMatrix::I(), clip, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key2(1, SkMatrix::I(), clip, image->uniqueID(), image->subset());
SkIPoint offset = SkIPoint::Make(3, 4);
cache->set(key1, image.get(), offset);
@@ -104,11 +104,11 @@
const sk_sp<SkSpecialImage>& image,
const sk_sp<SkSpecialImage>& subset) {
static const size_t kCacheSize = 1000000;
- SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kCacheSize));
+ SkAutoTUnref<SkImageFilterCache> cache(SkImageFilterCache::Create(kCacheSize));
SkIRect clip = SkIRect::MakeWH(100, 100);
- SkImageFilter::Cache::Key key1(0, SkMatrix::I(), clip, image->uniqueID(), image->subset());
- SkImageFilter::Cache::Key key2(1, SkMatrix::I(), clip, subset->uniqueID(), image->subset());
+ SkImageFilterCacheKey key1(0, SkMatrix::I(), clip, image->uniqueID(), image->subset());
+ SkImageFilterCacheKey key2(1, SkMatrix::I(), clip, subset->uniqueID(), image->subset());
SkIPoint offset = SkIPoint::Make(3, 4);
cache->set(key1, image.get(), offset);