OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 class BitmapFilterScaleBench: public BitmapScaleBench { | 89 class BitmapFilterScaleBench: public BitmapScaleBench { |
90 public: | 90 public: |
91 BitmapFilterScaleBench(void *param, int is, int os) : INHERITED(param, is, o
s) { | 91 BitmapFilterScaleBench(void *param, int is, int os) : INHERITED(param, is, o
s) { |
92 setName( "filter" ); | 92 setName( "filter" ); |
93 } | 93 } |
94 protected: | 94 protected: |
95 virtual void doScaleImage() SK_OVERRIDE { | 95 virtual void doScaleImage() SK_OVERRIDE { |
96 SkCanvas canvas( fOutputBitmap ); | 96 SkCanvas canvas( fOutputBitmap ); |
97 SkPaint paint; | 97 SkPaint paint; |
98 | 98 |
99 paint.setFlags( SkPaint::kHighQualityFilterBitmap_Flag | SkPaint::kFilte
rBitmap_Flag ); | 99 paint.setFilterLevel(SkPaint::kHigh_FilterLevel); |
100 | |
101 canvas.drawBitmapMatrix( fInputBitmap, fMatrix, &paint ); | 100 canvas.drawBitmapMatrix( fInputBitmap, fMatrix, &paint ); |
102 } | 101 } |
103 private: | 102 private: |
104 typedef BitmapScaleBench INHERITED; | 103 typedef BitmapScaleBench INHERITED; |
105 }; | 104 }; |
106 | 105 |
107 DEF_BENCH(return new BitmapFilterScaleBench(p, 10, 90);) | 106 DEF_BENCH(return new BitmapFilterScaleBench(p, 10, 90);) |
108 DEF_BENCH(return new BitmapFilterScaleBench(p, 30, 90);) | 107 DEF_BENCH(return new BitmapFilterScaleBench(p, 30, 90);) |
109 DEF_BENCH(return new BitmapFilterScaleBench(p, 80, 90);) | 108 DEF_BENCH(return new BitmapFilterScaleBench(p, 80, 90);) |
110 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 90);) | 109 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 90);) |
111 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 80);) | 110 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 80);) |
112 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 30);) | 111 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 30);) |
113 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 10);) | 112 DEF_BENCH(return new BitmapFilterScaleBench(p, 90, 10);) |
114 DEF_BENCH(return new BitmapFilterScaleBench(p, 256, 64);) | 113 DEF_BENCH(return new BitmapFilterScaleBench(p, 256, 64);) |
115 DEF_BENCH(return new BitmapFilterScaleBench(p, 64, 256);) | 114 DEF_BENCH(return new BitmapFilterScaleBench(p, 64, 256);) |
OLD | NEW |