Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: gm/downsamplebitmap.cpp

Issue 536103002: Turn downsamplebitmap GMs vertical to fit in 2048x2048. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/downsamplebitmap.cpp
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index fd35128173332d7b4fb18992a8bd60f75dfda1d2..19faaa08918912d3d0152eb39c91944b631d9a97 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:
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698