[chromium] Plumb damage from WebExternalTextureLayer and WebPluginContainer to CCDama...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 18:45:49 +0000 (18:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 18:45:49 +0000 (18:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73485

Patch by Jonathan Backer <backer@chromium.org> on 2011-12-07
Reviewed by Darin Fisher.

Source/WebCore:

* platform/graphics/chromium/PluginLayerChromium.cpp:
(WebCore::PluginLayerChromium::updateCompositorResources):
(WebCore::PluginLayerChromium::invalidateRect):
* platform/graphics/chromium/PluginLayerChromium.h:

Source/WebKit/chromium:

* public/platform/WebExternalTextureLayer.h:
* src/WebExternalTextureLayer.cpp:
(WebKit::WebExternalTextureLayer::invalidateRect):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::commitBackingTexture):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/platform/WebExternalTextureLayer.h
Source/WebKit/chromium/src/WebExternalTextureLayer.cpp
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

index eae46e7..8f86247 100644 (file)
@@ -1,3 +1,15 @@
+2011-12-07  Jonathan Backer  <backer@chromium.org>
+
+        [chromium] Plumb damage from WebExternalTextureLayer and WebPluginContainer to CCDamageTracker
+        https://bugs.webkit.org/show_bug.cgi?id=73485
+
+        Reviewed by Darin Fisher.
+
+        * platform/graphics/chromium/PluginLayerChromium.cpp:
+        (WebCore::PluginLayerChromium::updateCompositorResources):
+        (WebCore::PluginLayerChromium::invalidateRect):
+        * platform/graphics/chromium/PluginLayerChromium.h:
+
 2011-12-07  Mary Wu  <mary.wu@torchmobile.com.cn>
 
         Upstream 5 files into WebCore/platform/blackberry
index bec3319..e3c5c48 100644 (file)
@@ -52,6 +52,17 @@ PluginLayerChromium::PluginLayerChromium(CCLayerDelegate* delegate)
 {
 }
 
+void PluginLayerChromium::updateCompositorResources(GraphicsContext3D* rendererContext, CCTextureUpdater&)
+{
+    if (!m_needsDisplay)
+        return;
+
+    // PluginLayers are updated externally (outside of the compositor).
+    // |m_dirtyRect| covers the region that has changed since the last composite.
+    m_updateRect = m_dirtyRect;
+    m_dirtyRect = FloatRect();
+}
+
 PassRefPtr<CCLayerImpl> PluginLayerChromium::createCCLayerImpl()
 {
     return CCPluginLayerImpl::create(m_layerId);
@@ -99,5 +110,11 @@ void PluginLayerChromium::pushPropertiesTo(CCLayerImpl* layer)
     pluginLayer->setIOSurfaceProperties(m_ioSurfaceWidth, m_ioSurfaceHeight, m_ioSurfaceId);
 }
 
+void PluginLayerChromium::invalidateRect(const FloatRect& dirtyRect)
+{
+    setNeedsDisplayRect(dirtyRect);
+    m_dirtyRect.unite(dirtyRect);
+}
+
 }
 #endif // USE(ACCELERATED_COMPOSITING)
index 55b8df6..277a969 100644 (file)
@@ -38,6 +38,7 @@ class PluginLayerChromium : public LayerChromium {
 public:
     static PassRefPtr<PluginLayerChromium> create(CCLayerDelegate* = 0);
     virtual bool drawsContent() const { return true; }
+    virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
 
     virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
 
@@ -55,6 +56,8 @@ public:
 
     virtual void pushPropertiesTo(CCLayerImpl*);
 
+    void invalidateRect(const FloatRect& dirtyRect);
+
 protected:
     explicit PluginLayerChromium(CCLayerDelegate*);
 
@@ -65,6 +68,7 @@ private:
     int m_ioSurfaceWidth;
     int m_ioSurfaceHeight;
     uint32_t m_ioSurfaceId;
+    FloatRect m_dirtyRect;
 };
 
 }
index 124db01..697995f 100644 (file)
@@ -1,3 +1,16 @@
+2011-12-07  Jonathan Backer  <backer@chromium.org>
+
+        [chromium] Plumb damage from WebExternalTextureLayer and WebPluginContainer to CCDamageTracker
+        https://bugs.webkit.org/show_bug.cgi?id=73485
+
+        Reviewed by Darin Fisher.
+
+        * public/platform/WebExternalTextureLayer.h:
+        * src/WebExternalTextureLayer.cpp:
+        (WebKit::WebExternalTextureLayer::invalidateRect):
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::commitBackingTexture):
+
 2011-12-06  Dirk Pranke  <dpranke@chromium.org>
 
         Fix typo in WebKit.gyp introduced in previous change.
index 0a902f1..63d5485 100644 (file)
@@ -68,6 +68,10 @@ public:
     WEBKIT_EXPORT void setUVRect(const WebFloatRect&);
     WEBKIT_EXPORT WebFloatRect uvRect() const;
 
+    // Marks a region of the layer as needing a display. These regions are
+    // collected in a union until the display occurs.
+    WEBKIT_EXPORT void invalidateRect(const WebFloatRect&);
+
 #if WEBKIT_IMPLEMENTATION
     WebExternalTextureLayer(const WTF::PassRefPtr<WebExternalTextureLayerImpl>&);
     WebExternalTextureLayer& operator=(const WTF::PassRefPtr<WebExternalTextureLayerImpl>&);
index 83fa9cc..5a06c17 100644 (file)
@@ -66,6 +66,11 @@ WebFloatRect WebExternalTextureLayer::uvRect() const
     return WebFloatRect(constUnwrap<WebExternalTextureLayerImpl>()->uvRect());
 }
 
+void WebExternalTextureLayer::invalidateRect(const WebFloatRect& updateRect)
+{
+    unwrap<WebExternalTextureLayerImpl>()->invalidateRect(updateRect);
+}
+
 WebExternalTextureLayer::WebExternalTextureLayer(const PassRefPtr<WebExternalTextureLayerImpl>& node)
     : WebLayer(node)
 {
index 0911b45..948f5d6 100644 (file)
@@ -369,8 +369,8 @@ void WebPluginContainerImpl::setBackingIOSurfaceId(int width,
 void WebPluginContainerImpl::commitBackingTexture()
 {
 #if USE(ACCELERATED_COMPOSITING)
-    if (platformLayer())
-        platformLayer()->setNeedsDisplay();
+    if (m_platformLayer.get())
+        m_platformLayer->invalidateRect(FloatRect(FloatPoint(), m_platformLayer->bounds()));
 #endif
 }