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

Side by Side Diff: include/effects/SkArithmeticMode.h

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 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 2011 Google Inc. 2 * Copyright 2011 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 #ifndef SkArithmeticMode_DEFINED 8 #ifndef SkArithmeticMode_DEFINED
9 #define SkArithmeticMode_DEFINED 9 #define SkArithmeticMode_DEFINED
10 10
11 #include "SkFlattenable.h" 11 #include "SkFlattenable.h"
12 #include "SkScalar.h" 12 #include "SkScalar.h"
13 13 #include "SkXfermode.h"
14 class SkXfermode;
15 14
16 class SK_API SkArithmeticMode { 15 class SK_API SkArithmeticMode {
17 public: 16 public:
18 /** 17 /**
19 * result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4] 18 * result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4]
20 * 19 *
21 * k1=k2=k3=0, k4=1.0 results in returning opaque white 20 * k1=k2=k3=0, k4=1.0 results in returning opaque white
22 * k1=k3=k4=0, k2=1.0 results in returning the src 21 * k1=k3=k4=0, k2=1.0 results in returning the src
23 * k1=k2=k4=0, k3=1.0 results in returning the dst 22 * k1=k2=k4=0, k3=1.0 results in returning the dst
24 */ 23 */
24 static sk_sp<SkXfermode> Make(SkScalar k1, SkScalar k2, SkScalar k3, SkScala r k4,
25 bool enforcePMColor = true);
26 #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
25 static SkXfermode* Create(SkScalar k1, SkScalar k2, 27 static SkXfermode* Create(SkScalar k1, SkScalar k2,
26 SkScalar k3, SkScalar k4, 28 SkScalar k3, SkScalar k4,
27 bool enforcePMColor = true); 29 bool enforcePMColor = true) {
30 return Make(k1, k2, k3, k4, enforcePMColor).release();
31 }
32 #endif
28 33
29 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP(); 34 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP();
30 35
31 private: 36 private:
32 SkArithmeticMode(); // can't be instantiated 37 SkArithmeticMode(); // can't be instantiated
33 }; 38 };
34 39
35 #endif 40 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698