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

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

Issue 1607253002: Add gpu implementation of OverdrawXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update FP & XP Factory counts Created 4 years, 11 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 | « gyp/tests.gypi ('k') | src/effects/SkArithmeticMode_gpu.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 "SkArithmeticMode.h" 8 #include "SkArithmeticMode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 16 matching lines...) Expand all
27 SkScalarNearlyZero(k3) && SkScalarNearlyZero(k4)) { 27 SkScalarNearlyZero(k3) && SkScalarNearlyZero(k4)) {
28 return SkXfermode::Create(SkXfermode::kSrc_Mode); 28 return SkXfermode::Create(SkXfermode::kSrc_Mode);
29 } else if (SkScalarNearlyZero(k1) && SkScalarNearlyZero(k2) && 29 } else if (SkScalarNearlyZero(k1) && SkScalarNearlyZero(k2) &&
30 SkScalarNearlyEqual(k3, SK_Scalar1) && SkScalarNearlyZero(k4) ) { 30 SkScalarNearlyEqual(k3, SK_Scalar1) && SkScalarNearlyZero(k4) ) {
31 return SkXfermode::Create(SkXfermode::kDst_Mode); 31 return SkXfermode::Create(SkXfermode::kDst_Mode);
32 } 32 }
33 33
34 return new SkArithmeticMode_scalar(k1, k2, k3, k4, enforcePMColor); 34 return new SkArithmeticMode_scalar(k1, k2, k3, k4, enforcePMColor);
35 } 35 }
36 36
37 virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, 37 void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
38 const SkAlpha aa[]) const override; 38 const SkAlpha aa[]) const override;
39 39
40 SK_TO_STRING_OVERRIDE() 40 SK_TO_STRING_OVERRIDE()
41 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArithmeticMode_scalar) 41 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArithmeticMode_scalar)
42 42
43 #if SK_SUPPORT_GPU 43 #if SK_SUPPORT_GPU
44 bool asFragmentProcessor(const GrFragmentProcessor**, 44 bool asFragmentProcessor(const GrFragmentProcessor**,
45 const GrFragmentProcessor* dst) const override; 45 const GrFragmentProcessor* dst) const override;
46 46
47 bool asXPFactory(GrXPFactory**) const override; 47 bool asXPFactory(GrXPFactory**) const override;
48 #endif 48 #endif
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 fEnforcePMColor); 279 fEnforcePMColor);
280 } 280 }
281 return true; 281 return true;
282 } 282 }
283 283
284 #endif 284 #endif
285 285
286 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) 286 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode)
287 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) 287 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar)
288 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 288 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | src/effects/SkArithmeticMode_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698