Title: [93438] trunk/Source/WebCore
Revision
93438
Author
e...@google.com
Date
2011-08-19 14:24:17 -0700 (Fri, 19 Aug 2011)

Log Message

[chromium] Refactor updateCompositorResources to take an explicit GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=66432

Reviewed by James Robinson.

Covered by existing tests.

* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::updateCompositorResources):
* platform/graphics/chromium/Canvas2DLayerChromium.h:
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::updateCompositorResources):
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::updateCompositorResources):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::updateCompositorResources):
* platform/graphics/chromium/TiledLayerChromium.h:
* platform/graphics/chromium/VideoLayerChromium.cpp:
(WebCore::VideoLayerChromium::updateCompositorResources):
* platform/graphics/chromium/VideoLayerChromium.h:
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::updateCompositorResources):
* platform/graphics/chromium/WebGLLayerChromium.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (93437 => 93438)


--- trunk/Source/WebCore/ChangeLog	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/ChangeLog	2011-08-19 21:24:17 UTC (rev 93438)
@@ -1,3 +1,29 @@
+2011-08-18  Adrienne Walker  <e...@google.com>
+
+        [chromium] Refactor updateCompositorResources to take an explicit GraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=66432
+
+        Reviewed by James Robinson.
+
+        Covered by existing tests.
+
+        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+        (WebCore::Canvas2DLayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/Canvas2DLayerChromium.h:
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::updateCompositorResources):
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/TiledLayerChromium.h:
+        * platform/graphics/chromium/VideoLayerChromium.cpp:
+        (WebCore::VideoLayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/VideoLayerChromium.h:
+        * platform/graphics/chromium/WebGLLayerChromium.cpp:
+        (WebCore::WebGLLayerChromium::updateCompositorResources):
+        * platform/graphics/chromium/WebGLLayerChromium.h:
+
 2011-08-19  Victoria Kirst  <v...@chromium.org>
 
         Tell media player to prepareToPlay() at end of HTMLMediaElement::load()

Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp	2011-08-19 21:24:17 UTC (rev 93438)
@@ -66,7 +66,7 @@
             && (context->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR));
 }
 
-void Canvas2DLayerChromium::updateCompositorResources()
+void Canvas2DLayerChromium::updateCompositorResources(GraphicsContext3D*)
 {
     if (!m_contentsDirty || !drawsContent())
         return;

Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h	2011-08-19 21:24:17 UTC (rev 93438)
@@ -46,7 +46,7 @@
     static PassRefPtr<Canvas2DLayerChromium> create(DrawingBuffer*, GraphicsLayerChromium* owner);
     virtual ~Canvas2DLayerChromium();
     virtual bool drawsContent() const;
-    virtual void updateCompositorResources();
+    virtual void updateCompositorResources(GraphicsContext3D*);
 
     void setTextureChanged();
     virtual unsigned textureId() const;

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-08-19 21:24:17 UTC (rev 93438)
@@ -166,7 +166,7 @@
     // These methods typically need to be overwritten by derived classes.
     virtual bool drawsContent() const { return false; }
     virtual void paintContentsIfDirty() { }
-    virtual void updateCompositorResources() { }
+    virtual void updateCompositorResources(GraphicsContext3D*) { }
     virtual void setIsMask(bool) {}
     virtual void unreserveContentsTexture() { }
     virtual void bindContentsTexture() { }

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-08-19 21:24:17 UTC (rev 93438)
@@ -951,7 +951,7 @@
         updateCompositorResources(layer->replicaLayer());
 
     if (layer->drawsContent())
-        layer->updateCompositorResources();
+        layer->updateCompositorResources(context());
 }
 
 ManagedTexture* LayerRendererChromium::getOffscreenLayerTexture()

Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp	2011-08-19 21:24:17 UTC (rev 93438)
@@ -156,13 +156,12 @@
         isRootLayer() ? CCLayerTilingData::NoBorderTexels : CCLayerTilingData::HasBorderTexels);
 }
 
-void TiledLayerChromium::updateCompositorResources()
+void TiledLayerChromium::updateCompositorResources(GraphicsContext3D* context)
 {
     // Painting could cause compositing to get turned off, which may cause the tiler to become invalidated mid-update.
     if (m_skipsDraw || m_updateRect.isEmpty() || !m_tiler->numTiles())
         return;
 
-    GraphicsContext3D* context = layerRenderer()->context();
     int left, top, right, bottom;
     m_tiler->contentRectToTileIndices(m_updateRect, left, top, right, bottom);
     for (int j = top; j <= bottom; ++j) {

Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h	2011-08-19 21:24:17 UTC (rev 93438)
@@ -43,7 +43,7 @@
 
     virtual ~TiledLayerChromium();
 
-    virtual void updateCompositorResources();
+    virtual void updateCompositorResources(GraphicsContext3D*);
     virtual void setIsMask(bool);
 
     virtual void pushPropertiesTo(CCLayerImpl*);

Modified: trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp	2011-08-19 21:24:17 UTC (rev 93438)
@@ -94,7 +94,7 @@
         resetFrameParameters();
 }
 
-void VideoLayerChromium::updateCompositorResources()
+void VideoLayerChromium::updateCompositorResources(GraphicsContext3D* context)
 {
     if (!m_contentsDirty || !m_owner)
         return;
@@ -125,7 +125,6 @@
 
     // Allocate textures for planes if they are not allocated already, or
     // reallocate textures that are the wrong size for the frame.
-    GraphicsContext3D* context = layerRendererContext();
     bool texturesAllocated = allocateTexturesIfNeeded(context, frame, textureFormat);
     if (!texturesAllocated) {
         m_skipsDraw = true;

Modified: trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h	2011-08-19 21:24:17 UTC (rev 93438)
@@ -56,7 +56,7 @@
 
     virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
 
-    virtual void updateCompositorResources();
+    virtual void updateCompositorResources(GraphicsContext3D*);
     virtual bool drawsContent() const { return true; }
 
     // This function is called by VideoFrameProvider. When this method is called

Modified: trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp	2011-08-19 21:24:17 UTC (rev 93438)
@@ -68,7 +68,7 @@
     return (m_context && m_context->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR);
 }
 
-void WebGLLayerChromium::updateCompositorResources()
+void WebGLLayerChromium::updateCompositorResources(GraphicsContext3D* rendererContext)
 {
     if (!drawsContent())
         return;
@@ -76,7 +76,6 @@
     if (!m_contentsDirty)
         return;
 
-    GraphicsContext3D* rendererContext = layerRendererContext();
     if (m_textureChanged) {
         rendererContext->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId);
         // Set the min-mag filters to linear and wrap modes to GL_CLAMP_TO_EDGE

Modified: trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h (93437 => 93438)


--- trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h	2011-08-19 21:12:26 UTC (rev 93437)
+++ trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h	2011-08-19 21:24:17 UTC (rev 93438)
@@ -50,7 +50,7 @@
     virtual ~WebGLLayerChromium();
 
     virtual bool drawsContent() const;
-    virtual void updateCompositorResources();
+    virtual void updateCompositorResources(GraphicsContext3D*);
     void setTextureUpdated();
     bool paintRenderedResultsToCanvas(ImageBuffer*);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to