Changeset 86975 in webkit


Ignore:
Timestamp:
May 20, 2011 12:28:10 PM (13 years ago)
Author:
alokp@chromium.org
Message:

2011-05-20 Alok Priyadarshi <alokp@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):
Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86973 r86975  
     12011-05-20  Alok Priyadarshi  <alokp@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Remove LayerRendererChromium::useShader
     6        https://bugs.webkit.org/show_bug.cgi?id=61143
     7
     8        GPU compositor tests should be sufficient.
     9
     10        * platform/graphics/chromium/LayerRendererChromium.cpp:
     11        (WebCore::LayerRendererChromium::LayerRendererChromium):
     12        * platform/graphics/chromium/LayerRendererChromium.h:
     13        * platform/graphics/chromium/LayerTilerChromium.cpp:
     14        (WebCore::LayerTilerChromium::draw):
     15        * platform/graphics/chromium/RenderSurfaceChromium.cpp:
     16        (WebCore::RenderSurfaceChromium::drawSurface):
     17        * platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp:
     18        (WebCore::CCCanvasLayerImpl::draw):
     19        * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
     20        (WebCore::CCHeadsUpDisplay::draw):
     21        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
     22        (WebCore::CCLayerImpl::drawDebugBorder):
     23        * platform/graphics/chromium/cc/CCPluginLayerImpl.cpp:
     24        (WebCore::CCPluginLayerImpl::draw):
     25        * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
     26        (WebCore::CCVideoLayerImpl::drawYUV):
     27        (WebCore::CCVideoLayerImpl::drawRGBA):
     28
    1292011-05-20  Dirk Schulze  <krit@webkit.org>
    230
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r86805 r86975  
    113113    : m_viewportScrollPosition(IntPoint(-1, -1))
    114114    , m_rootLayer(0)
    115     , m_currentShader(0)
    116115    , m_currentRenderSurface(0)
    117116    , m_offscreenFramebufferId(0)
     
    152151    if (error != GraphicsContext3D::NO_ERROR)
    153152        LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error %x\n", file, line, command, static_cast<int>(error));
    154 }
    155 
    156 void LayerRendererChromium::useShader(unsigned programId)
    157 {
    158     if (programId != m_currentShader) {
    159         GLC(m_context.get(), m_context->useProgram(programId));
    160         m_currentShader = programId;
    161     }
    162153}
    163154
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r86805 r86975  
    113113    const TransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }
    114114
    115     void useShader(unsigned);
    116 
    117115    bool checkTextureSize(const IntSize&);
    118116
     
    197195    bool m_hardwareCompositing;
    198196
    199     unsigned m_currentShader;
    200197    RenderSurfaceChromium* m_currentRenderSurface;
    201198
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp

    r86805 r86975  
    338338    GraphicsContext3D* context = layerRendererContext();
    339339    const LayerTilerChromium::Program* program = layerRenderer()->tilerProgram();
    340     layerRenderer()->useShader(program->program());
     340    GLC(context, context->useProgram(program->program()));
    341341    GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
    342342
  • trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp

    r86652 r86975  
    112112        if (!maskLayer->bounds().isEmpty()) {
    113113            context3D->makeContextCurrent();
    114             layerRenderer()->useShader(maskProgram->program());
     114            GLC(context3D, context3D->useProgram(maskProgram->program()));
    115115            GLC(context3D, context3D->activeTexture(GraphicsContext3D::TEXTURE0));
    116116            GLC(context3D, context3D->uniform1i(maskProgram->fragmentShader().samplerLocation(), 0));
     
    127127
    128128    if (!useMask) {
    129         layerRenderer()->useShader(program->program());
     129        GLC(context3D, context3D->useProgram(program->program()));
    130130        m_contentsTexture->bindTexture();
    131131        GLC(context3D, context3D->uniform1i(program->fragmentShader().samplerLocation(), 0));
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp

    r86905 r86975  
    6565        GLC(context, context->blendFunc(sfactor, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
    6666    }
    67     layerRenderer()->useShader(program->program());
     67    GLC(context, context->useProgram(program->program()));
    6868    GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
    6969    LayerChromium::drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp

    r86805 r86975  
    125125    GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
    126126    m_hudTexture->bindTexture();
    127     m_layerRenderer->useShader(program->program());
     127    GLC(context, context->useProgram(program->program()));
    128128    GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
    129129
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r86652 r86975  
    182182
    183183    ASSERT(layerRenderer());
     184    GraphicsContext3D* context = layerRenderer()->context();
    184185    const LayerChromium::BorderProgram* program = layerRenderer()->borderProgram();
    185186    ASSERT(program && program->initialized());
    186     layerRenderer()->useShader(program->program());
     187    GLC(context, context->useProgram(program->program()));
     188
    187189    TransformationMatrix renderMatrix = drawTransform();
    188190    renderMatrix.scale3d(bounds().width(), bounds().height(), 1);
    189191    toGLMatrix(&glMatrix[0], layerRenderer()->projectionMatrix() * renderMatrix);
    190     GraphicsContext3D* context = layerRenderer()->context();
    191192    GLC(context, context->uniformMatrix4fv(program->vertexShader().matrixLocation(), false, &glMatrix[0], 1));
    192193
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp

    r86652 r86975  
    6363    GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
    6464
    65     layerRenderer()->useShader(program->program());
     65    GLC(context, context->useProgram(program->program()));
    6666    GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0));
    6767    LayerChromium::drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp

    r86652 r86975  
    116116    GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, vTexture.id));
    117117
    118     layerRenderer()->useShader(program->program());
     118    GLC(context, context->useProgram(program->program()));
    119119
    120120    float yWidthScaleFactor = static_cast<float>(yTexture.visibleSize.width()) / yTexture.size.width();
     
    148148    GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, texture.id));
    149149
    150     layerRenderer()->useShader(program->program());
     150    GLC(context, context->useProgram(program->program()));
    151151    float widthScaleFactor = static_cast<float>(texture.visibleSize.width()) / texture.size.width();
    152152    GLC(context, context->uniform4f(program->vertexShader().texTransformLocation(), 0, 0, widthScaleFactor, 1));
Note: See TracChangeset for help on using the changeset viewer.