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

Side by Side Diff: bench/CoverageBench.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/BlurImageFilterBench.cpp ('k') | bench/DisplacementBench.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 14 matching lines...) Expand all
25 bool fDrawCoverage; 25 bool fDrawCoverage;
26 public: 26 public:
27 DrawPathBench(bool drawCoverage) : fDrawCoverage(drawCoverage) { 27 DrawPathBench(bool drawCoverage) : fDrawCoverage(drawCoverage) {
28 fPaint.setAntiAlias(true); 28 fPaint.setAntiAlias(true);
29 fName.printf("draw_coverage_%s", drawCoverage ? "true" : "false"); 29 fName.printf("draw_coverage_%s", drawCoverage ? "true" : "false");
30 30
31 fPath.moveTo(0, 0); 31 fPath.moveTo(0, 0);
32 fPath.quadTo(500, 0, 500, 500); 32 fPath.quadTo(500, 0, 500, 500);
33 fPath.quadTo(250, 0, 0, 500); 33 fPath.quadTo(250, 0, 0, 500);
34 34
35 fBitmap.setConfig(SkBitmap::kA8_Config, 500, 500); 35 fBitmap.allocPixels(SkImageInfo::MakeA8(500, 500));
36 fBitmap.allocPixels();
37 36
38 fIdentity.setIdentity(); 37 fIdentity.setIdentity();
39 fRC.setRect(fPath.getBounds().round()); 38 fRC.setRect(fPath.getBounds().round());
40 39
41 fDraw.fBitmap = &fBitmap; 40 fDraw.fBitmap = &fBitmap;
42 fDraw.fMatrix = &fIdentity; 41 fDraw.fMatrix = &fIdentity;
43 fDraw.fClip = &fRC.bwRgn(); 42 fDraw.fClip = &fRC.bwRgn();
44 fDraw.fRC = &fRC; 43 fDraw.fRC = &fRC;
45 } 44 }
46 45
(...skipping 15 matching lines...) Expand all
62 } 61 }
63 62
64 private: 63 private:
65 typedef SkBenchmark INHERITED; 64 typedef SkBenchmark INHERITED;
66 }; 65 };
67 66
68 /////////////////////////////////////////////////////////////////////////////// 67 ///////////////////////////////////////////////////////////////////////////////
69 68
70 DEF_BENCH( return new DrawPathBench(false) ) 69 DEF_BENCH( return new DrawPathBench(false) )
71 DEF_BENCH( return new DrawPathBench(true) ) 70 DEF_BENCH( return new DrawPathBench(true) )
OLDNEW
« no previous file with comments | « bench/BlurImageFilterBench.cpp ('k') | bench/DisplacementBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698