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

Side by Side Diff: bench/RectoriBench.cpp

Issue 181433009: try to deprecate fFlagsMask from SkLayerDrawLooper (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | « bench/BlurRoundRectBench.cpp ('k') | gm/blurroundrect.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 W = 640, 69 W = 640,
70 H = 480, 70 H = 480,
71 }; 71 };
72 72
73 SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar sigma) { 73 SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar sigma) {
74 SkLayerDrawLooper* looper = new SkLayerDrawLooper; 74 SkLayerDrawLooper* looper = new SkLayerDrawLooper;
75 75
76 //----------------------------------------------- 76 //-----------------------------------------------
77 SkLayerDrawLooper::LayerInfo info; 77 SkLayerDrawLooper::LayerInfo info;
78 78
79 info.fFlagsMask = 0;
80 // TODO: add a color filter to better match what is seen in the wild 79 // TODO: add a color filter to better match what is seen in the wild
81 info.fPaintBits = /* SkLayerDrawLooper::kColorFilter_Bit |*/ 80 info.fPaintBits = /* SkLayerDrawLooper::kColorFilter_Bit |*/
82 SkLayerDrawLooper::kMaskFilter_Bit; 81 SkLayerDrawLooper::kMaskFilter_Bit;
83 info.fColorMode = SkXfermode::kDst_Mode; 82 info.fColorMode = SkXfermode::kDst_Mode;
84 info.fOffset.set(xOff, 0); 83 info.fOffset.set(xOff, 0);
85 info.fPostTranslate = false; 84 info.fPostTranslate = false;
86 85
87 SkPaint* paint = looper->addLayer(info); 86 SkPaint* paint = looper->addLayer(info);
88 87
89 SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_Bl urStyle, 88 SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_Bl urStyle,
90 sigma, 89 sigma,
91 SkBlurMaskFilter::kHighQuali ty_BlurFlag); 90 SkBlurMaskFilter::kHighQuali ty_BlurFlag);
92 paint->setMaskFilter(mf)->unref(); 91 paint->setMaskFilter(mf)->unref();
93 92
94 //----------------------------------------------- 93 //-----------------------------------------------
95 info.fPaintBits = 0; 94 info.fPaintBits = 0;
96 info.fOffset.set(0, 0); 95 info.fOffset.set(0, 0);
97 96
98 paint = looper->addLayer(info); 97 paint = looper->addLayer(info);
99 return looper; 98 return looper;
100 } 99 }
101 100
102 typedef SkBenchmark INHERITED; 101 typedef SkBenchmark INHERITED;
103 }; 102 };
104 103
105 DEF_BENCH( return SkNEW_ARGS(RectoriBench, ()); ) 104 DEF_BENCH( return SkNEW_ARGS(RectoriBench, ()); )
OLDNEW
« no previous file with comments | « bench/BlurRoundRectBench.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698