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

Unified Diff: include/core/SkPaint.h

Issue 203203005: update comment on setShader to clarify alpha-bitmap behavior in bitmapshaders (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« gm/bitmapshader.cpp ('K') | « gm/bitmapshader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPaint.h
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index d1853c613c35df29680c22cdbf3788ffa2050037..e86d01195c8e892d417c08b7d59b014af613e39e 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.
« gm/bitmapshader.cpp ('K') | « gm/bitmapshader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698