<rdar://problem/10912486> CanvasRenderingContext2D does not expose its backing store...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 22:33:40 +0000 (22:33 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 22:33:40 +0000 (22:33 +0000)
commit8c59c3d48f0ad34fdbc5fcec2b2d8dace52c4f02
tree1a14ef2135575a8eeba1ece4918edec098efdcf6
parentb32972762e1cebcc6ec3f1846b18740dcea6f978
<rdar://problem/10912486> CanvasRenderingContext2D does not expose its backing store resolution
https://bugs.webkit.org/show_bug.cgi?id=83619

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/canvas/2d.backingStorePixelRatio.html

Added a backingStorePixelRatio attribute to CanvasRenderingContext2D, as proposed in
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-March/035112.html>. The attribute
is prefixed with “webkit” for now.

* html/HTMLCanvasElement.h:
(WebCore::HTMLCanvasElement::deviceScaleFactor): Added this getter.
* html/canvas/CanvasRenderingContext2D.h:
(WebCore::CanvasRenderingContext2D::webkitBackingStorePixelRatio): Added. Returns the canvas
element’s device scale factor.
(CanvasRenderingContext2D):
* html/canvas/CanvasRenderingContext2D.idl: Added webkitBackingStorePixelRatio as a
read-only attribute.

LayoutTests:

* fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
* fast/canvas/2d.backingStorePixelRatio.html: Added.
* platform/mac/fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.
* platform/win/fast/canvas/2d.backingStorePixelRatio-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/2d.backingStorePixelRatio-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/2d.backingStorePixelRatio.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/canvas/2d.backingStorePixelRatio-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/fast/canvas/2d.backingStorePixelRatio-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLCanvasElement.h
Source/WebCore/html/canvas/CanvasRenderingContext2D.h
Source/WebCore/html/canvas/CanvasRenderingContext2D.idl