[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
mdelaney at apple.com
mdelaney at apple.com
Fri Jan 21 14:38:29 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit e849954621e96bf29b77a61184fd6d91f9cfa997
Author: mdelaney at apple.com <mdelaney at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 23 19:57:15 2010 +0000
2010-12-22 Matthew Delaney <mdelaney at apple.com>
Reviewed by Simon Fraser.
Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
This patch also changes USE_IOSURFACE to instead follow USE(IOSURFACE)
https://bugs.webkit.org/show_bug.cgi?id=51279
* html/HTMLCanvasElement.cpp: For IOSurface, use setNeedsStyleRecalc
* html/canvas/CanvasRenderingContext2D.cpp: Use new flag
* platform/graphics/ImageBuffer.h: Use new flag
* platform/graphics/cg/ImageBufferCG.cpp: Use new flag
2010-12-22 Matthew Delaney <mdelaney at apple.com>
Reviewed by Simon Fraser.
Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=51279
* platform/mac-snowleopard/platform/mac/compositing: Added.
* platform/mac-snowleopard/platform/mac/compositing/canvas: Added.
* platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
* platform/mac/compositing/canvas: Added.
* platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
* platform/mac/compositing/canvas/accelerated-canvas-compositing.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b65963a..6178f13 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-22 Matthew Delaney <mdelaney at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
+ https://bugs.webkit.org/show_bug.cgi?id=51279
+
+ * platform/mac-snowleopard/platform/mac/compositing: Added.
+ * platform/mac-snowleopard/platform/mac/compositing/canvas: Added.
+ * platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
+ * platform/mac/compositing/canvas: Added.
+ * platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
+ * platform/mac/compositing/canvas/accelerated-canvas-compositing.html: Added.
+
2010-12-23 Kenneth Russell <kbr at google.com>
Unreviewed Chromium expectations update. Fix incorrect syntax for
diff --git a/LayoutTests/platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt b/LayoutTests/platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt
new file mode 100644
index 0000000..638fc32
--- /dev/null
+++ b/LayoutTests/platform/mac-snowleopard/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt
@@ -0,0 +1,3 @@
+Tests whether an accelerated canvas creates a compositing layer.
+
+
diff --git a/LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt b/LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt
new file mode 100644
index 0000000..2e0c97c
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt
@@ -0,0 +1,18 @@
+Tests whether an accelerated canvas creates a compositing layer.
+
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 50.00)
+ (bounds 174.00 131.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
diff --git a/LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing.html b/LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing.html
new file mode 100644
index 0000000..ccc819e
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/canvas/accelerated-canvas-compositing.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html><html>
+<head>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function doTest() {
+ var c = document.getElementById('cvs_img2');
+ var ctx = c.getContext('2d');
+ ctx.fillStyle = 'rgba(255,0,0,1)';
+ ctx.fillRect(0,0,c.width, c.height);
+
+ if (window.layoutTestController) {
+ document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
+ layoutTestController.notifyDone();
+ }
+ }
+
+ window.addEventListener('load', doTest, false);
+</script>
+</head>
+<body>
+<p>Tests whether an accelerated canvas creates a compositing layer.</p>
+<canvas id="cvs_img2" width="174" height="131"></canvas>
+<pre id="layers">Layer tree goes here in DRT</pre>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 691af37..50bda84 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-22 Matthew Delaney <mdelaney at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Add setNeedsStyleRecalc for getting canvas contexts that use IOSurfaces
+ This patch also changes USE_IOSURFACE to instead follow USE(IOSURFACE)
+ https://bugs.webkit.org/show_bug.cgi?id=51279
+
+ * html/HTMLCanvasElement.cpp: For IOSurface, use setNeedsStyleRecalc
+ * html/canvas/CanvasRenderingContext2D.cpp: Use new flag
+ * platform/graphics/ImageBuffer.h: Use new flag
+ * platform/graphics/cg/ImageBufferCG.cpp: Use new flag
+
2010-12-20 Adrienne Walker <enne at google.com>
Reviewed by Kenneth Russell.
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 6e8e708..2b66b0c 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -157,7 +157,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas
usesDashbardCompatibilityMode = settings->usesDashboardBackwardCompatibilityMode();
#endif
m_context = adoptPtr(new CanvasRenderingContext2D(this, document()->inQuirksMode(), usesDashbardCompatibilityMode));
-#if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE) || (ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING))
if (m_context) {
// Need to make sure a RenderLayer and compositing layer get created for the Canvas
setNeedsStyleRecalc(SyntheticStyleChange);
@@ -384,7 +384,7 @@ void HTMLCanvasElement::createImageBuffer() const
if (!size.width() || !size.height())
return;
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
m_imageBuffer = ImageBuffer::create(size, ColorSpaceDeviceRGB, Accelerated);
#else
m_imageBuffer = ImageBuffer::create(size);
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 03f53b4..d498538 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -144,7 +144,7 @@ CanvasRenderingContext2D::~CanvasRenderingContext2D()
bool CanvasRenderingContext2D::isAccelerated() const
{
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
return true;
#elif ENABLE(ACCELERATED_2D_CANVAS)
return m_context3D;
@@ -1823,7 +1823,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
// FIXME: The rect is not big enough for miters on stroked text.
IntRect maskRect = enclosingIntRect(textRect);
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size(), ColorSpaceDeviceRGB, Accelerated);
#else
OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size());
diff --git a/WebCore/platform/graphics/ImageBuffer.h b/WebCore/platform/graphics/ImageBuffer.h
index 8f9abf3..56519dd 100644
--- a/WebCore/platform/graphics/ImageBuffer.h
+++ b/WebCore/platform/graphics/ImageBuffer.h
@@ -40,7 +40,7 @@
#include <wtf/PassRefPtr.h>
#if (PLATFORM(MAC) && PLATFORM(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
-#define USE_IOSURFACE 1
+#define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1
#endif
namespace WebCore {
diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index 7bc47f2..9c553b9 100644
--- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -42,7 +42,7 @@
#include <wtf/Threading.h>
#include <math.h>
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
#include <IOSurface/IOSurface.h>
#endif
@@ -54,7 +54,7 @@ using namespace std;
namespace WebCore {
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
static RetainPtr<IOSurfaceRef> createIOSurface(const IntSize& size)
{
unsigned pixelFormat = 'BGRA';
@@ -100,7 +100,7 @@ static void releaseImageData(void*, const void* data, size_t)
ImageBufferData::ImageBufferData(const IntSize&)
: m_data(0)
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
, m_surface(0)
#endif
{
@@ -111,7 +111,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace imageColorSpace, Render
, m_size(size)
, m_accelerateRendering(renderingMode == Accelerated)
{
-#if !defined(USE_IOSURFACE)
+#if !USE(IOSURFACE_CANVAS_BACKING_STORE)
ASSERT(renderingMode == Unaccelerated);
#endif
success = false; // Make early return mean failure.
@@ -148,7 +148,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace imageColorSpace, Render
// Create a live image that wraps the data.
m_data.m_dataProvider.adoptCF(CGDataProviderCreateWithData(0, m_data.m_data, dataSize, releaseImageData));
} else {
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
m_data.m_surface = createIOSurface(size);
cgContext.adoptCF(wkIOSurfaceContextCreate(m_data.m_surface.get(), size.width(), size.height(), m_data.m_colorSpace));
#else
@@ -185,7 +185,7 @@ PassRefPtr<Image> ImageBuffer::copyImage() const
CGImageRef ctxImage = 0;
if (!m_accelerateRendering)
ctxImage = CGBitmapContextCreateImage(context()->platformContext());
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
else
ctxImage = wkIOSurfaceContextCreateImage(context()->platformContext());
#endif
@@ -241,7 +241,7 @@ void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
RetainPtr<CGImageRef> image;
if (!m_accelerateRendering)
image.adoptCF(cgImage(m_size, m_data));
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
else
image.adoptCF(wkIOSurfaceContextCreateImage(platformContext));
#endif
@@ -309,7 +309,7 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i
destRows += destBytesPerRow;
}
} else {
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
IOSurfaceRef surface = imageData.m_surface.get();
IOSurfaceLock(surface, kIOSurfaceLockReadOnly, 0);
srcBytesPerRow = IOSurfaceGetBytesPerRow(surface);
@@ -410,7 +410,7 @@ void putImageData(ImageData*& source, const IntRect& sourceRect, const IntPoint&
srcRows += srcBytesPerRow;
}
} else {
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
IOSurfaceRef surface = imageData.m_surface.get();
IOSurfaceLock(surface, 0, 0);
destBytesPerRow = IOSurfaceGetBytesPerRow(surface);
@@ -496,7 +496,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality) con
RetainPtr<CGImageRef> image;
if (!m_accelerateRendering)
image.adoptCF(CGBitmapContextCreateImage(context()->platformContext()));
-#if defined(USE_IOSURFACE)
+#if USE(IOSURFACE_CANVAS_BACKING_STORE)
else
image.adoptCF(wkIOSurfaceContextCreateImage(context()->platformContext()));
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list