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

Side by Side Diff: gm/filterbitmap.cpp

Issue 17381008: More general version of image filtering; reworked to be robust and easier to SSE (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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
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 17 matching lines...) Expand all
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.setFilterBitmap(true);
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::kBicubicFilterBitmap_Flag); 38 paint.setFlags(paint.getFlags() | SkPaint::kHighQualityFilterBitmap_Flag);
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 | « bench/BitmapBench.cpp ('k') | gyp/core.gypi » ('j') | include/core/SkPaint.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698