diff options
author | 2014-03-18 16:28:12 +0000 | |
---|---|---|
committer | 2014-03-18 16:28:12 +0000 | |
commit | e5957f67d00c04c0fbf88809df510426e74fe40a (patch) | |
tree | a0efcaa717512a6875f3d719d1c145ca3f99d309 /include/core/SkPaint.h | |
parent | 14bdd527eebb3616227ef37a9ed23bc450a8bb5a (diff) |
update comment on setShader to clarify alpha-bitmap behavior in bitmapshaders
BUG=skia:2293
R=bsalomon@google.com, yunchao.he@intel.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/203203005
git-svn-id: http://skia.googlecode.com/svn/trunk@13851 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkPaint.h')
-rw-r--r-- | include/core/SkPaint.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index d1853c613c..e86d01195c 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -514,7 +514,12 @@ public: * 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 /> + * + * There is an exception to this only-respect-paint's-alpha rule: If the shader only generates + * alpha (e.g. SkShader::CreateBitmapShader(bitmap, ...) where bitmap's colortype is kAlpha_8) + * then the shader will use the paint's entire color to "colorize" its output (modulating the + * bitmap's alpha with the paint's color+alpha). + * * 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. |