diff options
author | caryclark@google.com <caryclark@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-11 14:50:39 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-11 14:50:39 +0000 |
commit | 3a761d29fc85af76d924dc6d28e5b96c3f903539 (patch) | |
tree | 083f5497b18f093f8ab7d0e141556b4ecbb1b6b8 /ui | |
parent | 5d474ff6e09b20d734a6074cbca3477bebcf76a9 (diff) | |
download | chromium_src-3a761d29fc85af76d924dc6d28e5b96c3f903539.zip chromium_src-3a761d29fc85af76d924dc6d28e5b96c3f903539.tar.gz chromium_src-3a761d29fc85af76d924dc6d28e5b96c3f903539.tar.bz2 |
Adjust the CoreGraphics context for offscreen layers.
UI elements like buttons are drawn on Mac by pointing
the CoreGraphics context at the Skia bitmap associated
with the current device. If the elements are drawn
in a transparent context, Skia creates an offscreen
layer to capture the draw, then applies the transparency.
CoreGraphics does not know that it is drawing to an
offscreen, so the clip and matrix need to be adjusted
by the offscreen's origin, which is its position on
the device.
Also, use getTopDevice() instead of getDevice() to
obtain the bitmap. Normally, they will return the same
SkDevice (and in that case, getOrigin() will return
(0,0)) but if there's a layer present, getDevice()
will return the actual device instead of the tempoary
offscreen.
BUG:108767
TEST:http://jsfiddle.net/casaschi/JWkfA/
Review URL: http://codereview.chromium.org/9129001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117217 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
0 files changed, 0 insertions, 0 deletions