Diff
Modified: branches/safari-536.28-branch/LayoutTests/ChangeLog (134738 => 134739)
--- branches/safari-536.28-branch/LayoutTests/ChangeLog 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/LayoutTests/ChangeLog 2012-11-15 06:11:11 UTC (rev 134739)
@@ -1,5 +1,22 @@
2012-11-14 Timothy Hatcher <timo...@apple.com>
+ Merge r134100
+
+ 2012-10-28 Timothy Hatcher <timo...@apple.com>
+
+ 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.
+
+2012-11-14 Timothy Hatcher <timo...@apple.com>
+
Merge r134099
2012-10-28 Timothy Hatcher <timo...@apple.com>
Modified: branches/safari-536.28-branch/Source/WebCore/ChangeLog (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/ChangeLog 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/ChangeLog 2012-11-15 06:11:11 UTC (rev 134739)
@@ -1,5 +1,37 @@
2012-11-14 Timothy Hatcher <timo...@apple.com>
+ Merge r134100
+
+ 2012-10-28 Timothy Hatcher <timo...@apple.com>
+
+ 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.
+
+2012-11-14 Timothy Hatcher <timo...@apple.com>
+
Merge r134099
2012-10-28 Timothy Hatcher <timo...@apple.com>
Modified: branches/safari-536.28-branch/Source/WebCore/html/HTMLCanvasElement.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/html/HTMLCanvasElement.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/html/HTMLCanvasElement.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -370,7 +370,7 @@
{
if (!m_presentedImage) {
// The buffer contains the last presented data, so save a copy of it.
- m_presentedImage = buffer()->copyImage(CopyBackingStore);
+ m_presentedImage = buffer()->copyImage(CopyBackingStore, Unscaled);
}
}
@@ -600,7 +600,7 @@
if (!m_copiedImage && buffer()) {
if (m_context)
m_context->paintRenderingResultsToCanvas();
- m_copiedImage = buffer()->copyImage(CopyBackingStore);
+ m_copiedImage = buffer()->copyImage(CopyBackingStore, Unscaled);
}
return m_copiedImage.get();
}
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/ImageBuffer.h (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/ImageBuffer.h 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/ImageBuffer.h 2012-11-15 06:11:11 UTC (rev 134739)
@@ -73,6 +73,11 @@
Deferred
};
+ enum ScaleBehavior {
+ Scaled,
+ Unscaled
+ };
+
class ImageBuffer {
WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED;
public:
@@ -94,7 +99,7 @@
GraphicsContext* context() const;
- PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore) const;
+ PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const;
enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSystem };
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -82,7 +82,7 @@
return m_context.get();
}
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
{
ASSERT(copyBehavior == CopyBackingStore);
// BitmapImage will release the passed in surface on destruction
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -212,10 +212,10 @@
return m_context.get();
}
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior scaleBehavior) const
{
RetainPtr<CGImageRef> image;
- if (m_resolutionScale == 1)
+ if (m_resolutionScale == 1 || scaleBehavior == Unscaled)
image = copyNativeImage(copyBehavior);
else {
image.adoptCF(copyNativeImage(DontCopyBackingStore));
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -117,7 +117,7 @@
return m_context.get();
}
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
{
if (copyBehavior == CopyBackingStore)
return StillImage::create(m_data.m_pixmap);
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -189,7 +189,7 @@
return m_context.get();
}
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
{
return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), copyBehavior == CopyBackingStore);
}
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -95,7 +95,7 @@
return m_context.get();
}
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
{
ASSERT(copyBehavior == CopyBackingStore);
return adoptRef(new BufferedImage(&m_data));
Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp (134738 => 134739)
--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp 2012-11-15 05:48:35 UTC (rev 134738)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp 2012-11-15 06:11:11 UTC (rev 134739)
@@ -145,7 +145,7 @@
return String();
}
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
{
ASSERT(copyBehavior == CopyBackingStore);