aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-09-24 00:50:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-24 00:50:58 -0700
commit7b6945bc4e639d7cc4a49b84d492690f8e865566 (patch)
treee566e960e63ebd15c29a6f39b33edbbc71e7c098 /samplecode
parentdd42e5c05ce2f5e6da9a055544849dd8ae4e6733 (diff)
remove unused (by the outside) SkImage::newSurface, and simplify newImage -> newSubset
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterQuality.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index 8bc2b07c5b..f5558d84f9 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -46,14 +46,14 @@ static SkImage* make_image() {
return surface->newImageSnapshot();
}
-static SkImage* zoom_up(SkImage* orig) {
+static SkImage* zoom_up(SkSurface* origSurf, SkImage* orig) {
const SkScalar S = 8; // amount to scale up
const int D = 2; // dimension scaling for the offscreen
// since we only view the center, don't need to produce the entire thing
SkImageInfo info = SkImageInfo::MakeN32(orig->width() * D, orig->height() * D,
kOpaque_SkAlphaType);
- SkAutoTUnref<SkSurface> surface(orig->newSurface(info));
+ SkAutoTUnref<SkSurface> surface(origSurf->newSurface(info));
SkCanvas* canvas = surface->getCanvas();
canvas->drawColor(SK_ColorWHITE);
canvas->scale(S, S);
@@ -221,7 +221,7 @@ protected:
if (surface) {
SkAutoTUnref<SkImage> orig(surface->newImageSnapshot());
- SkAutoTUnref<SkImage> zoomed(zoom_up(orig));
+ SkAutoTUnref<SkImage> zoomed(zoom_up(surface, orig));
origCanvas->drawImage(zoomed,
SkScalarHalf(fCell.width() - zoomed->width()),
SkScalarHalf(fCell.height() - zoomed->height()));