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
This commit is contained in:
mtklein 2014-09-03 13:40:52 -07:00 committed by Commit bot
parent 6233c7b2d3
commit 6a2f5fe867
2 changed files with 20 additions and 7 deletions

View File

@ -41,3 +41,16 @@ matrixconvolution
# 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

View File

@ -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: