aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/image_pict.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-12-09 16:51:55 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-12 15:15:15 +0000
commitc87f99ef0649a525471971c4edd8b57fc0f7ef3c (patch)
treea8e06d78794ace90cf2f7c1d6fd0f1c6f082e4e9 /gm/image_pict.cpp
parent0e18de9ed6af37ba729fea9696344fb8d3a0fbd2 (diff)
Make subset param to texture generation API non-optional
We were always already supplying this, makes it simpler BUG=skia: Change-Id: I36ac35205df5ab2a0fb7ec26e83ddb1547154816 Reviewed-on: https://skia-review.googlesource.com/5778 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'gm/image_pict.cpp')
-rw-r--r--gm/image_pict.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 76ea3d9590..3a84905a9b 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -221,7 +221,7 @@ public:
}
}
protected:
- GrTexture* onGenerateTexture(GrContext* ctx, const SkIRect* subset) override {
+ GrTexture* onGenerateTexture(GrContext* ctx, const SkIRect& subset) override {
if (ctx) {
SkASSERT(ctx == fCtx.get());
}
@@ -230,16 +230,13 @@ protected:
return nullptr;
}
- if (!subset) {
- return SkRef(fTexture.get());
- }
// need to copy the subset into a new texture
GrSurfaceDesc desc = fTexture->desc();
- desc.fWidth = subset->width();
- desc.fHeight = subset->height();
+ desc.fWidth = subset.width();
+ desc.fHeight = subset.height();
GrTexture* dst = fCtx->textureProvider()->createTexture(desc, SkBudgeted::kNo);
- fCtx->copySurface(dst, fTexture.get(), *subset, SkIPoint::Make(0, 0));
+ fCtx->copySurface(dst, fTexture.get(), subset, SkIPoint::Make(0, 0));
return dst;
}
private: