Source/WebCore: Make -webkit-canvas in CSS use the full backing store instead
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2012 20:39:39 +0000 (20:39 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2012 20:39:39 +0000 (20:39 +0000)
commitd81221cb78e577ece5b121d3d0bfb8d89ec06d09
treef7bc594fa0e6aac25a45aa16aefe0ff767ce34fd
parent87b36205a51dbff78fd41eead82d66b92a1eba23
Source/WebCore: Make -webkit-canvas in CSS use the full backing store instead
of always 1x when rendering.

https://bugs.webkit.org/show_bug.cgi?id=100611

Reviewed by Dean Jackson.

Test: fast/canvas/canvas-as-image-hidpi.html

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::makePresentationCopy): Pass Unscaled to copyImage.
(WebCore::HTMLCanvasElement::copiedImage): Ditto.
* platform/graphics/ImageBuffer.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::copyImage): Added Scale parameter and use copyNativeImage for Unscaled.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::copyImage): Added unnamed ScaleBehavior parameter.
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.
* platform/graphics/wince/ImageBufferWinCE.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.
* platform/graphics/wx/ImageBufferWx.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.

LayoutTests: Test if -webkit-canvas in CSS uses the full backing store instead
of always 1x when rendering.

https://bugs.webkit.org/show_bug.cgi?id=100611

Reviewed by Dean Jackson.

* fast/canvas/canvas-as-image-hidpi-expected.png: Added.
* fast/canvas/canvas-as-image-hidpi-expected.txt: Added.
* fast/canvas/canvas-as-image-hidpi.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/canvas-as-image-hidpi-expected.png [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-as-image-hidpi-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-as-image-hidpi.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp