aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-21 19:33:12 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-21 19:33:12 +0000
commit855e88edfafe4b3892e99f932c38fa7433b2fcbe (patch)
tree75b2ae89dfb43df24f10fa33cedf5bdadef398a1 /include
parent07b7462e1635c5f73ade09e3f6bf7ee57e7d1d6f (diff)
Fixes for SkPictureShader.
Update comment in header to make it more clear that the picture should be unaltered after creating the shader. We want our shaders to be immutable, and this supports that. Make the factory return NULL if the shader would have never drawn anyway i.e. for a null picture or picture with no width/height. Addresses comments I brought up in https://codereview.chromium.org/221923007/#msg16. BUG=skia:1976 R=reed@google.com, fmalita@chromium.org, robertphillips@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/238253005 git-svn-id: http://skia.googlecode.com/svn/trunk@14288 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkShader.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 076ecf5460..6566e691a4 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -349,7 +349,9 @@ public:
/** Call this to create a new shader that will draw with the specified picture.
*
* @param src The picture to use inside the shader (if not NULL, its ref count
- * is incremented).
+ * is incremented). The SkPicture must not be changed after
+ * successfully creating a picture shader.
+ * FIXME: src cannot be const due to SkCanvas::drawPicture
* @param tmx The tiling mode to use when sampling the bitmap in the x-direction.
* @param tmy The tiling mode to use when sampling the bitmap in the y-direction.
* @return Returns a new shader object. Note: this function never returns null.