Title: [86975] trunk/Source/WebCore
Revision
86975
Author
al...@chromium.org
Date
2011-05-20 12:28:10 -0700 (Fri, 20 May 2011)

Log Message

2011-05-20  Alok Priyadarshi  <al...@chromium.org>

        Reviewed by James Robinson.

        [chromium] Remove LayerRendererChromium::useShader
        https://bugs.webkit.org/show_bug.cgi?id=61143

        GPU compositor tests should be sufficient.

        * platform/graphics/chromium/LayerRendererChromium.cpp:
        (WebCore::LayerRendererChromium::LayerRendererChromium):
        * platform/graphics/chromium/LayerRendererChromium.h:
        * platform/graphics/chromium/LayerTilerChromium.cpp:
        (WebCore::LayerTilerChromium::draw):
        * platform/graphics/chromium/RenderSurfaceChromium.cpp:
        (WebCore::RenderSurfaceChromium::drawSurface):
        * platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp:
        (WebCore::CCCanvasLayerImpl::draw):
        * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
        (WebCore::CCHeadsUpDisplay::draw):
        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
        (WebCore::CCLayerImpl::drawDebugBorder):
        * platform/graphics/chromium/cc/CCPluginLayerImpl.cpp:
        (WebCore::CCPluginLayerImpl::draw):
        * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
        (WebCore::CCVideoLayerImpl::drawYUV):
        (WebCore::CCVideoLayerImpl::drawRGBA):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (86974 => 86975)


--- trunk/Source/WebCore/ChangeLog	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/ChangeLog	2011-05-20 19:28:10 UTC (rev 86975)
@@ -1,3 +1,31 @@
+2011-05-20  Alok Priyadarshi  <al...@chromium.org>
+
+        Reviewed by James Robinson.
+
+        [chromium] Remove LayerRendererChromium::useShader
+        https://bugs.webkit.org/show_bug.cgi?id=61143
+
+        GPU compositor tests should be sufficient.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::LayerRendererChromium):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        * platform/graphics/chromium/LayerTilerChromium.cpp:
+        (WebCore::LayerTilerChromium::draw):
+        * platform/graphics/chromium/RenderSurfaceChromium.cpp:
+        (WebCore::RenderSurfaceChromium::drawSurface):
+        * platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp:
+        (WebCore::CCCanvasLayerImpl::draw):
+        * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
+        (WebCore::CCHeadsUpDisplay::draw):
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        (WebCore::CCLayerImpl::drawDebugBorder):
+        * platform/graphics/chromium/cc/CCPluginLayerImpl.cpp:
+        (WebCore::CCPluginLayerImpl::draw):
+        * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+        (WebCore::CCVideoLayerImpl::drawYUV):
+        (WebCore::CCVideoLayerImpl::drawRGBA):
+
 2011-05-20  Dirk Schulze  <k...@webkit.org>
 
         Reviewed by Darin Adler.

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


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -112,7 +112,6 @@
                                              PassOwnPtr<LayerPainterChromium> contentPaint)
     : m_viewportScrollPosition(IntPoint(-1, -1))
     , m_rootLayer(0)
-    , m_currentShader(0)
     , m_currentRenderSurface(0)
     , m_offscreenFramebufferId(0)
     , m_compositeOffscreen(false)
@@ -153,14 +152,6 @@
         LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error %x\n", file, line, command, static_cast<int>(error));
 }
 
-void LayerRendererChromium::useShader(unsigned programId)
-{
-    if (programId != m_currentShader) {
-        GLC(m_context.get(), m_context->useProgram(programId));
-        m_currentShader = programId;
-    }
-}
-
 void LayerRendererChromium::invalidateRootLayerRect(const IntRect& dirtyRect)
 {
     m_rootLayerContentTiler->invalidateRect(dirtyRect);

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h	2011-05-20 19:28:10 UTC (rev 86975)
@@ -112,8 +112,6 @@
 
     const TransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }
 
-    void useShader(unsigned);
-
     bool checkTextureSize(const IntSize&);
 
     const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get(); }
@@ -196,7 +194,6 @@
 
     bool m_hardwareCompositing;
 
-    unsigned m_currentShader;
     RenderSurfaceChromium* m_currentRenderSurface;
 
     unsigned m_offscreenFramebufferId;

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -337,7 +337,7 @@
 
     GraphicsContext3D* context = layerRendererContext();
     const LayerTilerChromium::Program* program = layerRenderer()->tilerProgram();
-    layerRenderer()->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
     GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
 
     int left, top, right, bottom;

Modified: trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -111,7 +111,7 @@
     if (maskLayer && maskLayer->drawsContent()) {
         if (!maskLayer->bounds().isEmpty()) {
             context3D->makeContextCurrent();
-            layerRenderer()->useShader(maskProgram->program());
+            GLC(context3D, context3D->useProgram(maskProgram->program()));
             GLC(context3D, context3D->activeTexture(GraphicsContext3D::TEXTURE0));
             GLC(context3D, context3D->uniform1i(maskProgram->fragmentShader().samplerLocation(), 0));
             m_contentsTexture->bindTexture();
@@ -126,7 +126,7 @@
     }
 
     if (!useMask) {
-        layerRenderer()->useShader(program->program());
+        GLC(context3D, context3D->useProgram(program->program()));
         m_contentsTexture->bindTexture();
         GLC(context3D, context3D->uniform1i(program->fragmentShader().samplerLocation(), 0));
         shaderMatrixLocation = program->vertexShader().matrixLocation();

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -64,7 +64,7 @@
         GC3Denum sfactor = m_premultipliedAlpha ? GraphicsContext3D::ONE : GraphicsContext3D::SRC_ALPHA;
         GLC(context, context->blendFunc(sfactor, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
     }
-    layerRenderer()->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
     GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
     LayerChromium::drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
                                     bounds().width(), bounds().height(), drawOpacity(),

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -124,7 +124,7 @@
     ASSERT(program && program->initialized());
     GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
     m_hudTexture->bindTexture();
-    m_layerRenderer->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
     GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
 
     TransformationMatrix matrix;

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -181,13 +181,14 @@
         return;
 
     ASSERT(layerRenderer());
+    GraphicsContext3D* context = layerRenderer()->context();
     const LayerChromium::BorderProgram* program = layerRenderer()->borderProgram();
     ASSERT(program && program->initialized());
-    layerRenderer()->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
+
     TransformationMatrix renderMatrix = drawTransform();
     renderMatrix.scale3d(bounds().width(), bounds().height(), 1);
     toGLMatrix(&glMatrix[0], layerRenderer()->projectionMatrix() * renderMatrix);
-    GraphicsContext3D* context = layerRenderer()->context();
     GLC(context, context->uniformMatrix4fv(program->vertexShader().matrixLocation(), false, &glMatrix[0], 1));
 
     GLC(context, context->uniform4f(program->fragmentShader().colorLocation(), debugBorderColor().red() / 255.0, debugBorderColor().green() / 255.0, debugBorderColor().blue() / 255.0, 1));

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -62,7 +62,7 @@
     GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
     GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
 
-    layerRenderer()->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
     GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
     LayerChromium::drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
                                     bounds().width(), bounds().height(), drawOpacity(),

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp (86974 => 86975)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp	2011-05-20 19:06:29 UTC (rev 86974)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp	2011-05-20 19:28:10 UTC (rev 86975)
@@ -115,7 +115,7 @@
     GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE3));
     GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, vTexture.id));
 
-    layerRenderer()->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
 
     float yWidthScaleFactor = static_cast<float>(yTexture.visibleSize.width()) / yTexture.size.width();
     // Arbitrarily take the u sizes because u and v dimensions are identical.
@@ -147,7 +147,7 @@
     GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
     GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, texture.id));
 
-    layerRenderer()->useShader(program->program());
+    GLC(context, context->useProgram(program->program()));
     float widthScaleFactor = static_cast<float>(texture.visibleSize.width()) / texture.size.width();
     GLC(context, context->uniform4f(program->vertexShader().texTransformLocation(), 0, 0, widthScaleFactor, 1));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to