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
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index 1b3e4bd..9cbcdb7 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -41,3 +41,16 @@
# jvanverth
fontcache
+
+# mtklein
+downsamplebitmap_checkerboard_low_512_256
+downsamplebitmap_checkerboard_medium_512_256
+downsamplebitmap_checkerboard_none_512_256
+downsamplebitmap_image_high_mandrill_512
+downsamplebitmap_image_low_mandrill_512
+downsamplebitmap_image_medium_mandrill_512
+downsamplebitmap_image_none_mandrill_512
+downsamplebitmap_text_high_72.00pt
+downsamplebitmap_text_low_72.00pt
+downsamplebitmap_text_medium_72.00pt
+downsamplebitmap_text_none_72.00pt
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index fd35128..19faaa0 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -50,7 +50,7 @@
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 @@
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 @@
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: