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

Side by Side Diff: src/effects/SkArithmeticMode_gpu.cpp

Issue 1471293003: Create a static instances of SrcOver XferProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Build Created 5 years 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 | « include/gpu/GrXferProcessor.h ('k') | src/gpu/GrPipeline.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkArithmeticMode_gpu.h" 8 #include "SkArithmeticMode_gpu.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 float k1() const { return fK1; } 163 float k1() const { return fK1; }
164 float k2() const { return fK2; } 164 float k2() const { return fK2; }
165 float k3() const { return fK3; } 165 float k3() const { return fK3; }
166 float k4() const { return fK4; } 166 float k4() const { return fK4; }
167 bool enforcePMColor() const { return fEnforcePMColor; } 167 bool enforcePMColor() const { return fEnforcePMColor; }
168 168
169 private: 169 private:
170 GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations& optimizations, 170 GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations& optimizations,
171 bool doesStencilWrite, 171 bool doesStencilWrite,
172 GrColor* overrideColor, 172 GrColor* overrideColor,
173 const GrCaps& caps) override; 173 const GrCaps& caps) const overr ide;
174 174
175 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; 175 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
176 176
177 bool onIsEqual(const GrXferProcessor& xpBase) const override { 177 bool onIsEqual(const GrXferProcessor& xpBase) const override {
178 const ArithmeticXP& xp = xpBase.cast<ArithmeticXP>(); 178 const ArithmeticXP& xp = xpBase.cast<ArithmeticXP>();
179 if (fK1 != xp.fK1 || 179 if (fK1 != xp.fK1 ||
180 fK2 != xp.fK2 || 180 fK2 != xp.fK2 ||
181 fK3 != xp.fK3 || 181 fK3 != xp.fK3 ||
182 fK4 != xp.fK4 || 182 fK4 != xp.fK4 ||
183 fEnforcePMColor != xp.fEnforcePMColor) { 183 fEnforcePMColor != xp.fEnforcePMColor) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 void ArithmeticXP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB uilder* b) const { 253 void ArithmeticXP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB uilder* b) const {
254 GLArithmeticXP::GenKey(*this, caps, b); 254 GLArithmeticXP::GenKey(*this, caps, b);
255 } 255 }
256 256
257 GrGLSLXferProcessor* ArithmeticXP::createGLSLInstance() const { return new GLAri thmeticXP(*this); } 257 GrGLSLXferProcessor* ArithmeticXP::createGLSLInstance() const { return new GLAri thmeticXP(*this); }
258 258
259 GrXferProcessor::OptFlags ArithmeticXP::onGetOptimizations( 259 GrXferProcessor::OptFlags ArithmeticXP::onGetOptimizations(
260 const GrPipelineOptimizat ions& optimizations, 260 const GrPipelineOptimizat ions& optimizations,
261 bool doesStencilWrite, 261 bool doesStencilWrite,
262 GrColor* overrideColor, 262 GrColor* overrideColor,
263 const GrCaps& caps) { 263 const GrCaps& caps) const {
264 return GrXferProcessor::kNone_OptFlags; 264 return GrXferProcessor::kNone_OptFlags;
265 } 265 }
266 266
267 /////////////////////////////////////////////////////////////////////////////// 267 ///////////////////////////////////////////////////////////////////////////////
268 268
269 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float k4, 269 GrArithmeticXPFactory::GrArithmeticXPFactory(float k1, float k2, float k3, float k4,
270 bool enforcePMColor) 270 bool enforcePMColor)
271 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { 271 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) {
272 this->initClassID<GrArithmeticXPFactory>(); 272 this->initClassID<GrArithmeticXPFactory>();
273 } 273 }
(...skipping 23 matching lines...) Expand all
297 float k1 = d->fRandom->nextF(); 297 float k1 = d->fRandom->nextF();
298 float k2 = d->fRandom->nextF(); 298 float k2 = d->fRandom->nextF();
299 float k3 = d->fRandom->nextF(); 299 float k3 = d->fRandom->nextF();
300 float k4 = d->fRandom->nextF(); 300 float k4 = d->fRandom->nextF();
301 bool enforcePMColor = d->fRandom->nextBool(); 301 bool enforcePMColor = d->fRandom->nextBool();
302 302
303 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 303 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
304 } 304 }
305 305
306 #endif 306 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698