Commit Graph

4 Commits

Author SHA1 Message Date
fmalita
6cd1181bc1 Cleanup GM:pictureshadertile
Post review cleanup for https://codereview.chromium.org/733203005/

TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/784053002
2014-12-09 05:23:20 -08:00
fmalita
a2bd24fd15 Tweak SkPictureShader's tile semantics.
Currently, the tile offset is added when drawing the picture. This might
have made a tiny bit of sense when the picture was always positioned at
origin, but with a picture cull rect offset things looks really strange.

For example, to specify a tile == the picture cull rect we have to pass
in [-cullrect.x, -cullrect.y, cullrect.width, cullrect.height]. Yikes.

(there's also a bug when not passing a tile, as we use a default tile
== cullrect but don't compensate for the above oddity)

This changes the semantics of the tile offset: it is now subtracted when
drawing the picture tile. As a consequence, one can pass in a tile equal
to the cull rect and get the expected behavior (same when not passing
a tile).

This will require a minor Blink change with the roll, as one client
works around the current behavior:
https://codereview.chromium.org/789503003

R=reed@google.com,robertphillips@google.com
BUG=440046

Review URL: https://codereview.chromium.org/733203005
2014-12-08 11:13:27 -08:00
robertphillips
a8d7f0b13c Try out scalar picture sizes
This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect.

R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/513983002
2014-08-29 08:03:56 -07:00
fmalita
b5f7826c51 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
2014-08-06 13:07:15 -07:00