Title: [120501] trunk/Source/WebCore
- Revision
- 120501
- Author
- [email protected]
- Date
- 2012-06-15 15:24:05 -0700 (Fri, 15 Jun 2012)
Log Message
[chromium] Fix LayoutTests/platform/chromium/compositing/accelerated-drawing/svg-filters.html
https://bugs.webkit.org/show_bug.cgi?id=89126
Reviewed by Stephen White.
When drawing an image buffer into a deferred device context, we have to make a deep copy of the source (Skia
can't for some reason). Stephen White fixed this in r101325 by adding a bit on PlatformContextSkia indicating if
a given context is deferred, but I broke this again in r120346 by refactoring the SkCanvas creation to happen in
a different location from the PlatformContextSkia construction.
This moves the check into ImageBufferSkia and directly queries the state of the destination SkDevice to be more
robust and work without needing special PlatformContextSkia setup.
Covered by LayoutTests/platform/chromium/compositing/accelerated-drawing/svg-filters.html
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::drawNeedsCopy):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::PlatformContextSkia):
* platform/graphics/skia/PlatformContextSkia.h:
(PlatformContextSkia):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (120500 => 120501)
--- trunk/Source/WebCore/ChangeLog 2012-06-15 22:21:44 UTC (rev 120500)
+++ trunk/Source/WebCore/ChangeLog 2012-06-15 22:24:05 UTC (rev 120501)
@@ -1,3 +1,27 @@
+2012-06-15 James Robinson <[email protected]>
+
+ [chromium] Fix LayoutTests/platform/chromium/compositing/accelerated-drawing/svg-filters.html
+ https://bugs.webkit.org/show_bug.cgi?id=89126
+
+ Reviewed by Stephen White.
+
+ When drawing an image buffer into a deferred device context, we have to make a deep copy of the source (Skia
+ can't for some reason). Stephen White fixed this in r101325 by adding a bit on PlatformContextSkia indicating if
+ a given context is deferred, but I broke this again in r120346 by refactoring the SkCanvas creation to happen in
+ a different location from the PlatformContextSkia construction.
+
+ This moves the check into ImageBufferSkia and directly queries the state of the destination SkDevice to be more
+ robust and work without needing special PlatformContextSkia setup.
+
+ Covered by LayoutTests/platform/chromium/compositing/accelerated-drawing/svg-filters.html
+
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::drawNeedsCopy):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::PlatformContextSkia):
+ * platform/graphics/skia/PlatformContextSkia.h:
+ (PlatformContextSkia):
+
2012-06-15 Ami Fischman <[email protected]>
[chromium] Compositor should be aware of |flipped| status of video textures per-platform
Modified: trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (120500 => 120501)
--- trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp 2012-06-15 22:21:44 UTC (rev 120500)
+++ trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp 2012-06-15 22:24:05 UTC (rev 120501)
@@ -173,7 +173,12 @@
static bool drawNeedsCopy(GraphicsContext* src, GraphicsContext* dst)
{
- return dst->platformContext()->isDeferred() || src == dst;
+ if (src == dst)
+ return true;
+ // If we're rendering into a deferred canvas, we need to make a deep copy of the source pixels because Skia does not
+ // retain a reference to the actual pixels otherwise. We check if we're drawing into a deferred canvas by seeing if the
+ // device's bitmap configuration is set or not - if it's not, then we must not have a bitmap target yet.
+ return dst->platformContext()->canvas()->getDevice()->config() == SkBitmap::kNo_Config;
}
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
Modified: trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp (120500 => 120501)
--- trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp 2012-06-15 22:21:44 UTC (rev 120500)
+++ trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp 2012-06-15 22:24:05 UTC (rev 120501)
@@ -182,7 +182,6 @@
, m_trackOpaqueRegion(false)
, m_printing(false)
, m_accelerated(false)
- , m_deferred(false)
, m_drawingToImageBuffer(false)
{
m_stateStack.append(State());
Modified: trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h (120500 => 120501)
--- trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h 2012-06-15 22:21:44 UTC (rev 120500)
+++ trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h 2012-06-15 22:24:05 UTC (rev 120501)
@@ -186,12 +186,6 @@
bool isAccelerated() const { return m_accelerated; }
void setAccelerated(bool accelerated) { m_accelerated = accelerated; }
- // True if this context is deferring draw calls to be executed later.
- // We need to know this for context-to-context draws, in order to know if
- // the source bitmap needs to be copied.
- bool isDeferred() const { return m_deferred; }
- void setDeferred(bool deferred) { m_deferred = deferred; }
-
void setTrackOpaqueRegion(bool track) { m_trackOpaqueRegion = track; }
// This will be an empty region unless tracking is enabled.
@@ -241,7 +235,6 @@
FloatSize m_imageResamplingHintDstSize;
bool m_printing;
bool m_accelerated;
- bool m_deferred;
bool m_drawingToImageBuffer;
};
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes