Tweak SkPictureShader's tile semantics.
authorfmalita <fmalita@chromium.org>
Mon, 8 Dec 2014 19:13:27 +0000 (11:13 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 8 Dec 2014 19:13:27 +0000 (11:13 -0800)
commita2bd24fd15378d0a25d79b4aa2d76dddc4cf564c
tree7a503f1cffb0e8026a5845798b53fc5a70d15e4e
parentcf56009d9058d25933d9840bf6cf9fdf6a80f647
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
gm/pictureshadertile.cpp
src/core/SkPictureShader.cpp