aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/image_pict.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-04-26 16:20:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-27 18:31:19 +0000
commitdf7e075c74110fcfebdc49ca503684162e118af5 (patch)
tree4d4f55d2867115102a2d2460096c9fe8ce0ecb51 /gm/image_pict.cpp
parent0aa742f15a400433bafe6350c20523b4dd062f64 (diff)
Fold SkImageCacherator into SkImage_Lazy
SkImageCacherator still exists, but only as an interface implemented (solely) by SkImage_Lazy. The only external clients are GrImageTextureMaker and SkImage_Gpu::getDeferredTextureImageData. This is probably an improvement, but doesn't go as far as I'd hoped. Bug: skia: Change-Id: I6812badfabb6924b025621b21af00cbde9c16cac Reviewed-on: https://skia-review.googlesource.com/14371 Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'gm/image_pict.cpp')
-rw-r--r--gm/image_pict.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index c5e9fcfa9c..16ee896bfa 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -8,7 +8,7 @@
#include "gm.h"
#include "SkCanvas.h"
#include "SkImage.h"
-#include "SkImageCacherator.h"
+#include "SkImageGenerator.h"
#include "SkImage_Base.h"
#include "SkMakeUnique.h"
#include "SkPictureRecorder.h"
@@ -316,26 +316,15 @@ protected:
void makeCaches(GrContext* ctx) {
auto gen = fFactory(ctx, fPicture);
- SkDEBUGCODE(const uint32_t genID = gen->uniqueID();)
fImage = SkImage::MakeFromGenerator(std::move(gen));
const SkIRect subset = SkIRect::MakeLTRB(50, 50, 100, 100);
gen = fFactory(ctx, fPicture);
- SkDEBUGCODE(const uint32_t genSubsetID = gen->uniqueID();)
fImageSubset = SkImage::MakeFromGenerator(std::move(gen), &subset);
- // whole caches should have the same ID as the generator. Subsets should be diff
- SkDEBUGCODE(SkImageCacherator* cache = as_IB(fImage)->peekCacherator();)
- SkDEBUGCODE(SkImageCacherator* cacheSubset = as_IB(fImageSubset)->peekCacherator();)
- SkASSERT(cache);
- SkASSERT(cacheSubset);
- SkASSERT(cache->uniqueID() == genID);
- SkASSERT(cacheSubset->uniqueID() != genID);
- SkASSERT(cacheSubset->uniqueID() != genSubsetID);
-
- SkASSERT(cache->info().dimensions() == SkISize::Make(100, 100));
- SkASSERT(cacheSubset->info().dimensions() == SkISize::Make(50, 50));
+ SkASSERT(fImage->dimensions() == SkISize::Make(100, 100));
+ SkASSERT(fImageSubset->dimensions() == SkISize::Make(50, 50));
}
static void draw_as_bitmap(SkCanvas* canvas, SkImage* image, SkScalar x, SkScalar y) {