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

Side by Side Diff: include/core/SkColorShader.h

Issue 245963010: Move SkShader::fLocalMatrix into SkShader constructor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: uncomment setLocalMatrix Created 6 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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkColorShader_DEFINED 10 #ifndef SkColorShader_DEFINED
11 #define SkColorShader_DEFINED 11 #define SkColorShader_DEFINED
12 12
13 #include "SkShader.h" 13 #include "SkShader.h"
14 14
15 /** \class SkColorShader 15 /** \class SkColorShader
16 A Shader that represents a single color. In general, this effect can be 16 A Shader that represents a single color. In general, this effect can be
17 accomplished by just using the color field on the paint, but if an 17 accomplished by just using the color field on the paint, but if an
18 actual shader object is needed, this provides that feature. 18 actual shader object is needed, this provides that feature.
19 */ 19 */
20 class SK_API SkColorShader : public SkShader { 20 class SK_API SkColorShader : public SkShader {
21 public: 21 public:
22 /** Create a ColorShader that will inherit its color from the Paint 22 /** Create a ColorShader that will inherit its color from the Paint
23 at draw time. 23 at draw time.
24 */ 24 */
25 SkColorShader(); 25 SkColorShader(const SkMatrix* localMatrix = NULL);
scroggo 2014/04/23 19:01:28 FYI: I think Brian is removing this constructor.
26 26
27 /** Create a ColorShader that ignores the color in the paint, and uses the 27 /** Create a ColorShader that ignores the color in the paint, and uses the
28 specified color. Note: like all shaders, at draw time the paint's alpha 28 specified color. Note: like all shaders, at draw time the paint's alpha
29 will be respected, and is applied to the specified color. 29 will be respected, and is applied to the specified color.
30 */ 30 */
31 SkColorShader(SkColor c); 31 SkColorShader(SkColor c, const SkMatrix* localMatrix = NULL);
32 32
33 virtual bool isOpaque() const SK_OVERRIDE; 33 virtual bool isOpaque() const SK_OVERRIDE;
34 34
35 virtual SkShader::Context* createContext(const SkBitmap& device, 35 virtual SkShader::Context* createContext(const SkBitmap& device,
36 const SkPaint& paint, 36 const SkPaint& paint,
37 const SkMatrix& matrix, 37 const SkMatrix& matrix,
38 void* storage) const SK_OVERRIDE; 38 void* storage) const SK_OVERRIDE;
39 39
40 virtual size_t contextSize() const SK_OVERRIDE { 40 virtual size_t contextSize() const SK_OVERRIDE {
41 return sizeof(ColorShaderContext); 41 return sizeof(ColorShaderContext);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 75 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
76 76
77 private: 77 private:
78 SkColor fColor; // ignored if fInheritColor is true 78 SkColor fColor; // ignored if fInheritColor is true
79 SkBool8 fInheritColor; 79 SkBool8 fInheritColor;
80 80
81 typedef SkShader INHERITED; 81 typedef SkShader INHERITED;
82 }; 82 };
83 83
84 #endif 84 #endif
OLDNEW
« no previous file with comments | « gm/xfermodes3.cpp ('k') | include/core/SkShader.h » ('j') | src/animator/SkDrawGradient.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698