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

Side by Side Diff: bench/BitmapScaleBench.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« no previous file with comments | « bench/BitmapRectBench.cpp ('k') | bench/BlurImageFilterBench.cpp » ('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 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 SkIPoint onGetSize() SK_OVERRIDE { 51 SkIPoint onGetSize() SK_OVERRIDE {
52 return SkIPoint::Make( fOutputSize, fOutputSize ); 52 return SkIPoint::Make( fOutputSize, fOutputSize );
53 } 53 }
54 54
55 void setName(const char * name) { 55 void setName(const char * name) {
56 fName.printf( "bitmap_scale_%s_%d_%d", name, fInputSize, fOutputSize ); 56 fName.printf( "bitmap_scale_%s_%d_%d", name, fInputSize, fOutputSize );
57 } 57 }
58 58
59 virtual void onPreDraw() { 59 virtual void onPreDraw() {
60 fInputBitmap.setConfig(SkBitmap::kARGB_8888_Config, 60 fInputBitmap.allocN32Pixels(fInputSize, fInputSize, true);
61 fInputSize, fInputSize, 0, kOpaque_SkAlphaType);
62 fInputBitmap.allocPixels();
63 fInputBitmap.eraseColor(SK_ColorWHITE); 61 fInputBitmap.eraseColor(SK_ColorWHITE);
64 62
65 fOutputBitmap.setConfig(SkBitmap::kARGB_8888_Config, 63 fOutputBitmap.allocN32Pixels(fOutputSize, fOutputSize, true);
66 fOutputSize, fOutputSize, 0, kOpaque_SkAlphaType );
67 fOutputBitmap.allocPixels();
68 64
69 fMatrix.setScale( scale(), scale() ); 65 fMatrix.setScale( scale(), scale() );
70 } 66 }
71 67
72 virtual void onDraw(const int loops, SkCanvas*) { 68 virtual void onDraw(const int loops, SkCanvas*) {
73 SkPaint paint; 69 SkPaint paint;
74 this->setupPaint(&paint); 70 this->setupPaint(&paint);
75 71
76 preBenchSetup(); 72 preBenchSetup();
77 73
(...skipping 28 matching lines...) Expand all
106 102
107 DEF_BENCH(return new BitmapFilterScaleBench(10, 90);) 103 DEF_BENCH(return new BitmapFilterScaleBench(10, 90);)
108 DEF_BENCH(return new BitmapFilterScaleBench(30, 90);) 104 DEF_BENCH(return new BitmapFilterScaleBench(30, 90);)
109 DEF_BENCH(return new BitmapFilterScaleBench(80, 90);) 105 DEF_BENCH(return new BitmapFilterScaleBench(80, 90);)
110 DEF_BENCH(return new BitmapFilterScaleBench(90, 90);) 106 DEF_BENCH(return new BitmapFilterScaleBench(90, 90);)
111 DEF_BENCH(return new BitmapFilterScaleBench(90, 80);) 107 DEF_BENCH(return new BitmapFilterScaleBench(90, 80);)
112 DEF_BENCH(return new BitmapFilterScaleBench(90, 30);) 108 DEF_BENCH(return new BitmapFilterScaleBench(90, 30);)
113 DEF_BENCH(return new BitmapFilterScaleBench(90, 10);) 109 DEF_BENCH(return new BitmapFilterScaleBench(90, 10);)
114 DEF_BENCH(return new BitmapFilterScaleBench(256, 64);) 110 DEF_BENCH(return new BitmapFilterScaleBench(256, 64);)
115 DEF_BENCH(return new BitmapFilterScaleBench(64, 256);) 111 DEF_BENCH(return new BitmapFilterScaleBench(64, 256);)
OLDNEW
« no previous file with comments | « bench/BitmapRectBench.cpp ('k') | bench/BlurImageFilterBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698