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

Side by Side Diff: bench/ShaderMaskBench.cpp

Issue 248033003: Remove support for inheriting the paint color from SkColorShader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fColor -> color Created 6 years, 8 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 | « no previous file | bench/valgrind.supp » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorShader.h" 10 #include "SkColorShader.h"
(...skipping 26 matching lines...) Expand all
37 SkString fText; 37 SkString fText;
38 SkString fName; 38 SkString fName;
39 FontQuality fFQ; 39 FontQuality fFQ;
40 public: 40 public:
41 ShaderMaskBench(bool isOpaque, FontQuality fq) { 41 ShaderMaskBench(bool isOpaque, FontQuality fq) {
42 fFQ = fq; 42 fFQ = fq;
43 fText.set(STR); 43 fText.set(STR);
44 44
45 fPaint.setAntiAlias(kBW != fq); 45 fPaint.setAntiAlias(kBW != fq);
46 fPaint.setLCDRenderText(kLCD == fq); 46 fPaint.setLCDRenderText(kLCD == fq);
47 fPaint.setAlpha(isOpaque ? 0xFF : 0x80); 47 fPaint.setShader(new SkColorShader(isOpaque ? 0xFFFFFFFF : 0x80808080))- >unref();
48 fPaint.setShader(new SkColorShader)->unref();
49 } 48 }
50 49
51 protected: 50 protected:
52 virtual const char* onGetName() { 51 virtual const char* onGetName() {
53 fName.printf("shadermask"); 52 fName.printf("shadermask");
54 fName.appendf("_%s", fontQualityName(fPaint)); 53 fName.appendf("_%s", fontQualityName(fPaint));
55 fName.appendf("_%02X", fPaint.getAlpha()); 54 fName.appendf("_%02X", fPaint.getAlpha());
56 return fName.c_str(); 55 return fName.c_str();
57 } 56 }
58 57
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 }; 89 };
91 90
92 /////////////////////////////////////////////////////////////////////////////// 91 ///////////////////////////////////////////////////////////////////////////////
93 92
94 DEF_BENCH( return new ShaderMaskBench(true, kBW); ) 93 DEF_BENCH( return new ShaderMaskBench(true, kBW); )
95 DEF_BENCH( return new ShaderMaskBench(false, kBW); ) 94 DEF_BENCH( return new ShaderMaskBench(false, kBW); )
96 DEF_BENCH( return new ShaderMaskBench(true, kAA); ) 95 DEF_BENCH( return new ShaderMaskBench(true, kAA); )
97 DEF_BENCH( return new ShaderMaskBench(false, kAA); ) 96 DEF_BENCH( return new ShaderMaskBench(false, kAA); )
98 DEF_BENCH( return new ShaderMaskBench(true, kLCD); ) 97 DEF_BENCH( return new ShaderMaskBench(true, kLCD); )
99 DEF_BENCH( return new ShaderMaskBench(false, kLCD); ) 98 DEF_BENCH( return new ShaderMaskBench(false, kLCD); )
OLDNEW
« no previous file with comments | « no previous file | bench/valgrind.supp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698