aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2014-08-06 13:07:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-06 13:07:15 -0700
commitb5f7826c51af2862aebcabe61e1ba684f925e488 (patch)
treed4f679b74224259eaa59f57fd83fd7a984b4a22d /include/core
parent3c7edda88e275bcdaeb5d3afd0428a21f1635d13 (diff)
Explicit tile bounds for SkPictureShader
The integer picture size is not granular enough to allow precise tiling in arbitrary coordinate systems. This CL adds an optional tile bounds float rect param to control the tile size and location. (this also allows tile spacing emulation for picture shaders). R=reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/437393003
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkShader.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index e5af40dd7a..4f3fd29693 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -428,10 +428,17 @@ public:
* 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.
+ * @param tile The tile rectangle in picture coordinates: this represents the subset
+ * (or superset) of the picture used when building a tile. It is not
+ * affected by localMatrix and does not imply scaling (only translation
+ * and cropping). If null, the tile rect is considered equal to the picture
+ * bounds.
* @return Returns a new shader object. Note: this function never returns null.
*/
- static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy,
- const SkMatrix* localMatrix = NULL);
+ static SkShader* CreatePictureShader(SkPicture* src,
+ TileMode tmx, TileMode tmy,
+ const SkMatrix* localMatrix,
+ const SkRect* tile);
/**
* Return a shader that will apply the specified localMatrix to the proxy shader.