diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPaint.h | 23 | ||||
-rw-r--r-- | include/core/SkShader.h | 11 |
2 files changed, 22 insertions, 12 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index b4ea89413d..54e12ffa4f 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -484,14 +484,21 @@ public: SkShader* getShader() const { return fShader; } /** Set or clear the shader object. - <p /> - Pass NULL to clear any previous shader. - As a convenience, the parameter passed is also returned. - If a previous shader exists, its reference count is decremented. - If shader is not NULL, its reference count is incremented. - @param shader May be NULL. The shader to be installed in the paint - @return shader - */ + * Shaders specify the source color(s) for what is being drawn. If a paint + * has no shader, then the paint's color is used. If the paint has a + * shader, then the shader's color(s) are use instead, but they are + * modulated by the paint's alpha. This makes it easy to create a shader + * once (e.g. bitmap tiling or gradient) and then change its transparency + * w/o having to modify the original shader... only the paint's alpha needs + * to be modified. + * <p /> + * Pass NULL to clear any previous shader. + * As a convenience, the parameter passed is also returned. + * If a previous shader exists, its reference count is decremented. + * If shader is not NULL, its reference count is incremented. + * @param shader May be NULL. The shader to be installed in the paint + * @return shader + */ SkShader* setShader(SkShader* shader); /** Get the paint's colorfilter. If there is a colorfilter, its reference diff --git a/include/core/SkShader.h b/include/core/SkShader.h index c48c36998b..0fb6454408 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -20,10 +20,13 @@ class SkPath; /** \class SkShader * - * SkShader is the based class for objects that return horizontal spans of - * colors during drawing. A subclass of SkShader is installed in a SkPaint - * calling paint.setShader(shader). After that any object (other than a bitmap) - * that is drawn with that paint will get its color(s) from the shader. + * Shaders specify the source color(s) for what is being drawn. If a paint + * has no shader, then the paint's color is used. If the paint has a + * shader, then the shader's color(s) are use instead, but they are + * modulated by the paint's alpha. This makes it easy to create a shader + * once (e.g. bitmap tiling or gradient) and then change its transparency + * w/o having to modify the original shader... only the paint's alpha needs + * to be modified. */ class SK_API SkShader : public SkFlattenable { public: |