[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
senorblanco at chromium.org
senorblanco at chromium.org
Wed Dec 22 13:48:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e690544ed0e66ec786f1353d84a195d3608255b9
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 27 17:44:54 2010 +0000
2010-09-23 Stephen White <senorblanco at chromium.org>
Reviewed by James Robinson.
[CHROMIUM] Fix for canvas clearRect() with clipping active, when
--enable-accelerated-2d-canvas is on.
https://bugs.webkit.org/show_bug.cgi?id=46412
Covered by layout test http://philip.html5.org/tests/canvas/suite/tests/2d.clearRect.clip.html.
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::clearRect):
Check if a clip is active during clipRect(), and force to software
if so. Force a readback in this case, since clearRect() is not
compatible with mixed-mode rendering.
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::canvasClipApplied):
* platform/graphics/skia/PlatformContextSkia.h:
Implement accessor to check if a clip is active.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dfc3140..3206772 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-09-23 Stephen White <senorblanco at chromium.org>
+
+ Reviewed by James Robinson.
+
+ [CHROMIUM] Fix for canvas clearRect() with clipping active, when
+ --enable-accelerated-2d-canvas is on.
+ https://bugs.webkit.org/show_bug.cgi?id=46412
+
+ Covered by layout test http://philip.html5.org/tests/canvas/suite/tests/2d.clearRect.clip.html.
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::clearRect):
+ Check if a clip is active during clipRect(), and force to software
+ if so. Force a readback in this case, since clearRect() is not
+ compatible with mixed-mode rendering.
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::canvasClipApplied):
+ * platform/graphics/skia/PlatformContextSkia.h:
+ Implement accessor to check if a clip is active.
+
2010-09-14 Zhenyao Mo <zmo at google.com>
Reviewed by Kenneth Russell.
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index d618c19..4bc98fb 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -338,13 +338,15 @@ void GraphicsContext::clearRect(const FloatRect& rect)
if (paintingDisabled())
return;
- if (platformContext()->useGPU()) {
+ if (platformContext()->useGPU() && !platformContext()->canvasClipApplied()) {
platformContext()->prepareForHardwareDraw();
platformContext()->gpuCanvas()->clearRect(rect);
return;
}
- platformContext()->prepareForSoftwareDraw();
+ // Force a readback here (if we're using the GPU), since clearRect() is
+ // incompatible with mixed-mode rendering.
+ platformContext()->syncSoftwareCanvas();
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r))
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index e08c465..ccaefba 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -677,6 +677,11 @@ bool PlatformContextSkia::canAccelerate() const
&& !m_state->m_canvasClipApplied; // Can't accelerate with a clip to path applied.
}
+bool PlatformContextSkia::canvasClipApplied() const
+{
+ return m_state->m_canvasClipApplied;
+}
+
class WillPublishCallbackImpl : public DrawingBuffer::WillPublishCallback {
public:
static PassOwnPtr<WillPublishCallback> create(PlatformContextSkia* pcs)
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 4ba85d1..eb03224 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -180,6 +180,7 @@ public:
bool hasImageResamplingHint() const;
bool canAccelerate() const;
+ bool canvasClipApplied() const;
bool useGPU() { return m_useGPU; }
void setSharedGraphicsContext3D(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&);
GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list