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

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

Issue 1037123003: Implement support for KHR_blend_equation_advanced (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_zzz2_barriers
Patch Set: Created 5 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
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 "SkArithmeticMode.h" 8 #include "SkArithmeticMode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 15 matching lines...) Expand all
26 26
27 virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, 27 virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
28 const SkAlpha aa[]) const override; 28 const SkAlpha aa[]) const override;
29 29
30 SK_TO_STRING_OVERRIDE() 30 SK_TO_STRING_OVERRIDE()
31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArithmeticMode_scalar) 31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArithmeticMode_scalar)
32 32
33 #if SK_SUPPORT_GPU 33 #if SK_SUPPORT_GPU
34 bool asFragmentProcessor(GrFragmentProcessor**, GrTexture* background) const override; 34 bool asFragmentProcessor(GrFragmentProcessor**, GrTexture* background) const override;
35 35
36 bool asXPFactory(GrXPFactory**) const override; 36 bool asXPFactory(const GrContext*, GrXPFactory**) const override;
37 #endif 37 #endif
38 38
39 private: 39 private:
40 SkArithmeticMode_scalar(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4, bool enforcePMColor) { 40 SkArithmeticMode_scalar(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4, bool enforcePMColor) {
41 fK[0] = k1; 41 fK[0] = k1;
42 fK[1] = k2; 42 fK[1] = k2;
43 fK[2] = k3; 43 fK[2] = k3;
44 fK[3] = k4; 44 fK[3] = k4;
45 fEnforcePMColor = enforcePMColor; 45 fEnforcePMColor = enforcePMColor;
46 } 46 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 *fp = GrArithmeticFP::Create(SkScalarToFloat(fK[0]), 240 *fp = GrArithmeticFP::Create(SkScalarToFloat(fK[0]),
241 SkScalarToFloat(fK[1]), 241 SkScalarToFloat(fK[1]),
242 SkScalarToFloat(fK[2]), 242 SkScalarToFloat(fK[2]),
243 SkScalarToFloat(fK[3]), 243 SkScalarToFloat(fK[3]),
244 fEnforcePMColor, 244 fEnforcePMColor,
245 background); 245 background);
246 } 246 }
247 return true; 247 return true;
248 } 248 }
249 249
250 bool SkArithmeticMode_scalar::asXPFactory(GrXPFactory** xpf) const { 250 bool SkArithmeticMode_scalar::asXPFactory(const GrContext*, GrXPFactory** xpf) c onst {
251 if (xpf) { 251 if (xpf) {
252 *xpf = GrArithmeticXPFactory::Create(SkScalarToFloat(fK[0]), 252 *xpf = GrArithmeticXPFactory::Create(SkScalarToFloat(fK[0]),
253 SkScalarToFloat(fK[1]), 253 SkScalarToFloat(fK[1]),
254 SkScalarToFloat(fK[2]), 254 SkScalarToFloat(fK[2]),
255 SkScalarToFloat(fK[3]), 255 SkScalarToFloat(fK[3]),
256 fEnforcePMColor); 256 fEnforcePMColor);
257 } 257 }
258 return true; 258 return true;
259 } 259 }
260 260
261 #endif 261 #endif
262 262
263 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) 263 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode)
264 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) 264 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar)
265 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 265 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698