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

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

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Integrating readFoo changes Created 7 years, 2 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
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 "SkXfermode.h" 11 #include "SkFlattenable.h"
12 #include "SkScalar.h"
12 13
13 class SK_API SkArithmeticMode : public SkXfermode { 14 class SkXfermode;
15
16 class SK_API SkArithmeticMode {
reed1 2013/10/16 15:20:20 nice catch
14 public: 17 public:
15 /** 18 /**
16 * result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4] 19 * result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4]
17 * 20 *
18 * src and dst are treated as being [0.0 .. 1.0]. The polynomial is 21 * src and dst are treated as being [0.0 .. 1.0]. The polynomial is
19 * evaluated on their unpremultiplied components. 22 * evaluated on their unpremultiplied components.
20 * 23 *
21 * k1=k2=k3=0, k4=1.0 results in returning opaque white 24 * 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 25 * 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 26 * k1=k2=k4=0, k3=1.0 results in returning the dst
24 */ 27 */
25 static SkXfermode* Create(SkScalar k1, SkScalar k2, 28 static SkXfermode* Create(SkScalar k1, SkScalar k2,
26 SkScalar k3, SkScalar k4); 29 SkScalar k3, SkScalar k4);
27 30
28 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP(); 31 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP();
29 32
30 private: 33 private:
31 typedef SkXfermode INHERITED; 34 SkArithmeticMode(); // can't be instantiated
32 }; 35 };
33 36
34 #endif 37 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698