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

Side by Side Diff: gm/filterbitmap.cpp

Issue 19825002: stop using bitmap-filter flags outside of paint itself, as a step towards really changing them into… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/downsamplebitmap.cpp ('k') | include/core/SkPaint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 10
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 static void draw_col(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, 26 static void draw_col(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat,
27 SkScalar dx) { 27 SkScalar dx) {
28 SkPaint paint; 28 SkPaint paint;
29 29
30 SkAutoCanvasRestore acr(canvas, true); 30 SkAutoCanvasRestore acr(canvas, true);
31 31
32 canvas->drawBitmapMatrix(bm, mat, &paint); 32 canvas->drawBitmapMatrix(bm, mat, &paint);
33 33
34 paint.setFilterBitmap(true); 34 paint.setFilterLevel(SkPaint::kLow_FilterLevel);
35 canvas->translate(dx, 0); 35 canvas->translate(dx, 0);
36 canvas->drawBitmapMatrix(bm, mat, &paint); 36 canvas->drawBitmapMatrix(bm, mat, &paint);
37 37
38 paint.setFlags(paint.getFlags() | SkPaint::kHighQualityFilterBitmap_Flag); 38 paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
39 canvas->translate(dx, 0); 39 canvas->translate(dx, 0);
40 canvas->drawBitmapMatrix(bm, mat, &paint); 40 canvas->drawBitmapMatrix(bm, mat, &paint);
41 } 41 }
42 42
43 class FilterBitmapGM : public skiagm::GM { 43 class FilterBitmapGM : public skiagm::GM {
44 void onOnceBeforeDraw() { 44 void onOnceBeforeDraw() {
45 45
46 make_bitmap(); 46 make_bitmap();
47 47
48 SkScalar cx = SkScalarHalf(fBM.width()); 48 SkScalar cx = SkScalarHalf(fBM.width());
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) 230 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); )
231 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) 231 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); )
232 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) 232 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); )
233 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) 233 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); )
234 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) 234 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); )
235 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) 235 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); )
236 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) 236 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); )
237 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) 237 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); )
238 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) 238 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); )
239 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) 239 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); )
OLDNEW
« no previous file with comments | « gm/downsamplebitmap.cpp ('k') | include/core/SkPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698