aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-09-03 13:40:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-03 13:40:52 -0700
commit6a2f5fe8677f27d737da0e4e6dd1f814fbdbb6fc (patch)
tree45b7851862a21108db6db57c08e54610e7730468 /gm
parent6233c7b2d3f0b5dcc331e88d8029523bdf08217a (diff)
Turn downsamplebitmap GMs vertical to fit in 2048x2048.
BUG=skia:2911 R=bsalomon@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/536103002
Diffstat (limited to 'gm')
-rw-r--r--gm/downsamplebitmap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index fd35128173..19faaa0891 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -50,7 +50,7 @@ protected:
virtual SkISize onISize() SK_OVERRIDE {
make_bitmap_wrapper();
- return SkISize::Make(4 * fBM.width(), fBM.height());
+ return SkISize::Make(fBM.width(), 4 * fBM.height());
}
void make_bitmap_wrapper() {
@@ -65,8 +65,8 @@ protected:
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
make_bitmap_wrapper();
- int curX = 0;
- int curWidth;
+ int curY = 0;
+ int curHeight;
float curScale = 1;
do {
@@ -77,14 +77,14 @@ protected:
paint.setFilterLevel(fFilterLevel);
canvas->save();
- canvas->translate( (SkScalar) curX, 0.f );
+ canvas->translate(0, (SkScalar)curY);
canvas->drawBitmapMatrix( fBM, matrix, &paint );
canvas->restore();
- curWidth = (int) (fBM.width() * curScale + 2);
- curX += curWidth;
+ curHeight = (int) (fBM.height() * curScale + 2);
+ curY += curHeight;
curScale *= 0.75f;
- } while (curWidth >= 2 && curX < 4*fBM.width());
+ } while (curHeight >= 2 && curY < 4*fBM.height());
}
private: