Make SkImageFilter::Cache purging methods pure virtual

This is intended to see if the Windows 10 bots ignoring of the purge methods is a compiler bug.

TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1901883002

Review URL: https://codereview.chromium.org/1901883002
This commit is contained in:
robertphillips 2016-04-18 14:49:57 -07:00 committed by Commit bot
parent c7d01d3e1d
commit bde57ed11b
3 changed files with 7 additions and 2 deletions

View File

@ -47,8 +47,9 @@ public:
virtual SkSpecialImage* get(const Key& key, SkIPoint* offset) const = 0;
virtual void set(const Key& key, const SkBitmap& result, const SkIPoint& offset) = 0;
virtual void set(const Key& key, SkSpecialImage* image, const SkIPoint& offset) = 0;
virtual void purge() {}
virtual void purgeByKeys(const Key[], int) {}
virtual void purge() = 0;
virtual void purgeByKeys(const Key[], int) = 0;
SkDEBUGCODE(virtual int count() const = 0;)
};
class Context {

View File

@ -646,6 +646,7 @@ public:
}
}
SkDEBUGCODE(int count() const override { return fLookup.count(); })
private:
void removeInternal(Value* v) {
if (v->fImage) {

View File

@ -113,6 +113,7 @@ static void test_explicit_purging(skiatest::Reporter* reporter,
SkIPoint offset = SkIPoint::Make(3, 4);
cache->set(key1, image.get(), offset);
cache->set(key2, image.get(), offset);
SkDEBUGCODE(REPORTER_ASSERT(reporter, 2 == cache->count());)
SkIPoint foundOffset;
@ -120,11 +121,13 @@ static void test_explicit_purging(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, cache->get(key2, &foundOffset));
cache->purgeByKeys(&key1, 1);
SkDEBUGCODE(REPORTER_ASSERT(reporter, 1 == cache->count());)
REPORTER_ASSERT(reporter, !cache->get(key1, &foundOffset));
REPORTER_ASSERT(reporter, cache->get(key2, &foundOffset));
cache->purge();
SkDEBUGCODE(REPORTER_ASSERT(reporter, 0 == cache->count());)
REPORTER_ASSERT(reporter, !cache->get(key1, &foundOffset));
REPORTER_ASSERT(reporter, !cache->get(key2, &foundOffset));