Changeset 88835 in webkit


Ignore:
Timestamp:
Jun 14, 2011 11:32:36 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-14 James Robinson <jamesr@chromium.org>

Reviewed by Stephen White.

[chromium] Compositor shader initialization is inefficient
https://bugs.webkit.org/show_bug.cgi?id=62618

This fixes several issues causing slowdowns in compositor shader initialization, mostly due to lack of
parallelism:

  • Avoid initializing all programs eagerly. We only use two programs on every page, the other programs depend on content and are constructed on demand.
  • Defer querying uniform locations until draw time. For the eagerly constructed programs (render surface + tiler) this means that the GPU process has a chance to compile the shader while the renderer is busy painting+uploading instead of blocking on shader compilation in order to get uniform locations.
  • Calls to query COMPILE_STATUS/LINK_STATUS moved behind #ifndef NDEBUG guards since these should never fail in release builds and force synchronous compilation/linking.

This also adds a number of TRACE_EVENT()s to make analysing the performance of this bit of code easier.

  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::updateLayers): (WebCore::LayerRendererChromium::initializeSharedObjects): (WebCore::LayerRendererChromium::borderProgram): (WebCore::LayerRendererChromium::headsUpDisplayProgram): (WebCore::LayerRendererChromium::renderSurfaceProgram): (WebCore::LayerRendererChromium::renderSurfaceMaskProgram): (WebCore::LayerRendererChromium::tilerProgram): (WebCore::LayerRendererChromium::canvasLayerProgram): (WebCore::LayerRendererChromium::pluginLayerProgram): (WebCore::LayerRendererChromium::videoLayerRGBAProgram): (WebCore::LayerRendererChromium::videoLayerYUVProgram):
  • platform/graphics/chromium/LayerRendererChromium.h:
  • platform/graphics/chromium/LayerTextureSubImage.cpp: (WebCore::LayerTextureSubImage::uploadWithTexSubImage): (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
  • platform/graphics/chromium/ProgramBinding.cpp: (WebCore::ProgramBindingBase::init): (WebCore::ProgramBindingBase::loadShader): (WebCore::ProgramBindingBase::createShaderProgram):
  • platform/graphics/chromium/ProgramBinding.h: (WebCore::ProgramBinding::ProgramBinding): (WebCore::ProgramBinding::initialize):
  • platform/graphics/chromium/ShaderChromium.cpp: (WebCore::VertexShaderPosTex::init): (WebCore::VertexShaderPosTexYUVStretch::init): (WebCore::VertexShaderPos::init): (WebCore::VertexShaderPosTexTransform::init): (WebCore::FragmentTexAlphaBinding::init): (WebCore::FragmentShaderRGBATexAlphaMask::init): (WebCore::FragmentShaderYUVVideo::init): (WebCore::FragmentShaderColor::init):
  • platform/graphics/chromium/ShaderChromium.h:

2011-06-14 James Robinson <jamesr@chromium.org>

Reviewed by Stephen White.

[chromium] Compositor shader initialization is inefficient
https://bugs.webkit.org/show_bug.cgi?id=62618

Add a TRACE_EVENT() around initial compositor initialization.

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88833 r88835  
     12011-06-14  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Stephen White.
     4
     5        [chromium] Compositor shader initialization is inefficient
     6        https://bugs.webkit.org/show_bug.cgi?id=62618
     7
     8        This fixes several issues causing slowdowns in compositor shader initialization, mostly due to lack of
     9        parallelism:
     10
     11        - Avoid initializing all programs eagerly. We only use two programs on every page, the other programs depend on
     12        content and are constructed on demand.
     13
     14        - Defer querying uniform locations until draw time.  For the eagerly constructed programs (render surface +
     15        tiler) this means that the GPU process has a chance to compile the shader while the renderer is busy
     16        painting+uploading instead of blocking on shader compilation in order to get uniform locations.
     17
     18        - Calls to query COMPILE_STATUS/LINK_STATUS moved behind #ifndef NDEBUG guards since these should never fail in
     19        release builds and force synchronous compilation/linking.
     20
     21        This also adds a number of TRACE_EVENT()s to make analysing the performance of this bit of code easier.
     22
     23        * platform/graphics/chromium/LayerRendererChromium.cpp:
     24        (WebCore::LayerRendererChromium::updateLayers):
     25        (WebCore::LayerRendererChromium::initializeSharedObjects):
     26        (WebCore::LayerRendererChromium::borderProgram):
     27        (WebCore::LayerRendererChromium::headsUpDisplayProgram):
     28        (WebCore::LayerRendererChromium::renderSurfaceProgram):
     29        (WebCore::LayerRendererChromium::renderSurfaceMaskProgram):
     30        (WebCore::LayerRendererChromium::tilerProgram):
     31        (WebCore::LayerRendererChromium::canvasLayerProgram):
     32        (WebCore::LayerRendererChromium::pluginLayerProgram):
     33        (WebCore::LayerRendererChromium::videoLayerRGBAProgram):
     34        (WebCore::LayerRendererChromium::videoLayerYUVProgram):
     35        * platform/graphics/chromium/LayerRendererChromium.h:
     36        * platform/graphics/chromium/LayerTextureSubImage.cpp:
     37        (WebCore::LayerTextureSubImage::uploadWithTexSubImage):
     38        (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
     39        * platform/graphics/chromium/ProgramBinding.cpp:
     40        (WebCore::ProgramBindingBase::init):
     41        (WebCore::ProgramBindingBase::loadShader):
     42        (WebCore::ProgramBindingBase::createShaderProgram):
     43        * platform/graphics/chromium/ProgramBinding.h:
     44        (WebCore::ProgramBinding::ProgramBinding):
     45        (WebCore::ProgramBinding::initialize):
     46        * platform/graphics/chromium/ShaderChromium.cpp:
     47        (WebCore::VertexShaderPosTex::init):
     48        (WebCore::VertexShaderPosTexYUVStretch::init):
     49        (WebCore::VertexShaderPos::init):
     50        (WebCore::VertexShaderPosTexTransform::init):
     51        (WebCore::FragmentTexAlphaBinding::init):
     52        (WebCore::FragmentShaderRGBATexAlphaMask::init):
     53        (WebCore::FragmentShaderYUVVideo::init):
     54        (WebCore::FragmentShaderColor::init):
     55        * platform/graphics/chromium/ShaderChromium.h:
     56
    1572011-06-14  Stephanie Lewis  <slewis@apple.com>
    258
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r88496 r88835  
    350350    updateCompositorResources(renderSurfaceLayerList);
    351351    // Update compositor resources for root layer.
    352     m_rootLayerContentTiler->updateRect();
     352    {
     353        TRACE_EVENT("LayerRendererChromium::updateLayer::updateRoot", this, 0);
     354        m_rootLayerContentTiler->updateRect();
     355    }
    353356
    354357    // After updateCompositorResources, set/wait latches for all child
     
    10751078bool LayerRendererChromium::initializeSharedObjects()
    10761079{
     1080    TRACE_EVENT("LayerRendererChromium::initializeSharedObjects", this, 0);
    10771081    makeContextCurrent();
    10781082
     
    10841088    GLC(m_context.get(), m_offscreenFramebufferId = m_context->createFramebuffer());
    10851089
     1090    // We will always need these programs to render, so create the programs eagerly so that the shader compilation can
     1091    // start while we do other work. Other programs are created lazily on first access.
    10861092    m_sharedGeometry = adoptPtr(new GeometryBinding(m_context.get()));
    1087     m_borderProgram = adoptPtr(new LayerChromium::BorderProgram(m_context.get()));
    1088     m_headsUpDisplayProgram = adoptPtr(new CCHeadsUpDisplay::Program(m_context.get()));
    1089     m_canvasLayerProgram = adoptPtr(new CCCanvasLayerImpl::Program(m_context.get()));
    1090     m_videoLayerRGBAProgram = adoptPtr(new CCVideoLayerImpl::RGBAProgram(m_context.get()));
    1091     m_videoLayerYUVProgram = adoptPtr(new CCVideoLayerImpl::YUVProgram(m_context.get()));
    1092     m_pluginLayerProgram = adoptPtr(new CCPluginLayerImpl::Program(m_context.get()));
    10931093    m_renderSurfaceProgram = adoptPtr(new RenderSurfaceChromium::Program(m_context.get()));
    1094     m_renderSurfaceMaskProgram = adoptPtr(new RenderSurfaceChromium::MaskProgram(m_context.get()));
    10951094    m_tilerProgram = adoptPtr(new LayerTilerChromium::Program(m_context.get()));
    10961095
    1097     if (!m_sharedGeometry->initialized() || !m_borderProgram->initialized()
    1098         || !m_canvasLayerProgram->initialized()
    1099         || !m_headsUpDisplayProgram->initialized()
    1100         || !m_videoLayerRGBAProgram->initialized() || !m_videoLayerYUVProgram->initialized()
    1101         || !m_pluginLayerProgram->initialized() || !m_renderSurfaceProgram->initialized()
    1102         || !m_renderSurfaceMaskProgram->initialized() || !m_tilerProgram->initialized()) {
    1103         LOG_ERROR("Compositor failed to initialize shaders. Falling back to software.");
    1104         cleanupSharedObjects();
    1105         return false;
    1106     }
     1096    GLC(m_context.get(), m_context->flush());
    11071097
    11081098    m_textureManager = TextureManager::create(m_context.get(), textureMemoryLimitBytes, m_maxTextureSize);
    11091099    return true;
    11101100}
     1101
     1102const LayerChromium::BorderProgram* LayerRendererChromium::borderProgram()
     1103{
     1104    if (!m_borderProgram)
     1105        m_borderProgram = adoptPtr(new LayerChromium::BorderProgram(m_context.get()));
     1106    if (!m_borderProgram->initialized()) {
     1107        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1108        m_borderProgram->initialize();
     1109    }
     1110    return m_borderProgram.get();
     1111}
     1112
     1113const CCHeadsUpDisplay::Program* LayerRendererChromium::headsUpDisplayProgram()
     1114{
     1115    if (!m_headsUpDisplayProgram)
     1116        m_headsUpDisplayProgram = adoptPtr(new CCHeadsUpDisplay::Program(m_context.get()));
     1117    if (!m_headsUpDisplayProgram->initialized()) {
     1118        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1119        m_headsUpDisplayProgram->initialize();
     1120    }
     1121    return m_headsUpDisplayProgram.get();
     1122}
     1123
     1124const RenderSurfaceChromium::Program* LayerRendererChromium::renderSurfaceProgram()
     1125{
     1126    ASSERT(m_renderSurfaceProgram);
     1127    if (!m_renderSurfaceProgram->initialized()) {
     1128        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1129        m_renderSurfaceProgram->initialize();
     1130    }
     1131    return m_renderSurfaceProgram.get();
     1132}
     1133
     1134const RenderSurfaceChromium::MaskProgram* LayerRendererChromium::renderSurfaceMaskProgram()
     1135{
     1136    if (!m_renderSurfaceMaskProgram)
     1137        m_renderSurfaceMaskProgram = adoptPtr(new RenderSurfaceChromium::MaskProgram(m_context.get()));
     1138    if (!m_renderSurfaceMaskProgram->initialized()) {
     1139        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1140        m_renderSurfaceMaskProgram->initialize();
     1141    }
     1142    return m_renderSurfaceMaskProgram.get();
     1143}
     1144
     1145const LayerTilerChromium::Program* LayerRendererChromium::tilerProgram()
     1146{
     1147    ASSERT(m_tilerProgram);
     1148    if (!m_tilerProgram->initialized()) {
     1149        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1150        m_tilerProgram->initialize();
     1151    }
     1152    return m_tilerProgram.get();
     1153}
     1154
     1155const CCCanvasLayerImpl::Program* LayerRendererChromium::canvasLayerProgram()
     1156{
     1157    if (!m_canvasLayerProgram)
     1158        m_canvasLayerProgram = adoptPtr(new CCCanvasLayerImpl::Program(m_context.get()));
     1159    if (!m_canvasLayerProgram->initialized()) {
     1160        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1161        m_canvasLayerProgram->initialize();
     1162    }
     1163    return m_canvasLayerProgram.get();
     1164}
     1165
     1166const CCPluginLayerImpl::Program* LayerRendererChromium::pluginLayerProgram()
     1167{
     1168    if (!m_pluginLayerProgram)
     1169        m_pluginLayerProgram = adoptPtr(new CCPluginLayerImpl::Program(m_context.get()));
     1170    if (!m_pluginLayerProgram->initialized()) {
     1171        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1172        m_pluginLayerProgram->initialize();
     1173    }
     1174    return m_pluginLayerProgram.get();
     1175}
     1176
     1177const CCVideoLayerImpl::RGBAProgram* LayerRendererChromium::videoLayerRGBAProgram()
     1178{
     1179    if (!m_videoLayerRGBAProgram)
     1180        m_videoLayerRGBAProgram = adoptPtr(new CCVideoLayerImpl::RGBAProgram(m_context.get()));
     1181    if (!m_videoLayerRGBAProgram->initialized()) {
     1182        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1183        m_videoLayerRGBAProgram->initialize();
     1184    }
     1185    return m_videoLayerRGBAProgram.get();
     1186}
     1187
     1188const CCVideoLayerImpl::YUVProgram* LayerRendererChromium::videoLayerYUVProgram()
     1189{
     1190    if (!m_videoLayerYUVProgram)
     1191        m_videoLayerYUVProgram = adoptPtr(new CCVideoLayerImpl::YUVProgram(m_context.get()));
     1192    if (!m_videoLayerYUVProgram->initialized()) {
     1193        TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0);
     1194        m_videoLayerYUVProgram->initialize();
     1195    }
     1196    return m_videoLayerYUVProgram.get();
     1197}
     1198
    11111199
    11121200void LayerRendererChromium::cleanupSharedObjects()
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r87822 r88835  
    125125
    126126    const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get(); }
    127     const LayerChromium::BorderProgram* borderProgram() const { return m_borderProgram.get(); }
    128     const CCHeadsUpDisplay::Program* headsUpDisplayProgram() const { return m_headsUpDisplayProgram.get(); }
    129     const RenderSurfaceChromium::Program* renderSurfaceProgram() const { return m_renderSurfaceProgram.get(); }
    130     const RenderSurfaceChromium::MaskProgram* renderSurfaceMaskProgram() const { return m_renderSurfaceMaskProgram.get(); }
    131     const LayerTilerChromium::Program* tilerProgram() const { return m_tilerProgram.get(); }
    132     const CCCanvasLayerImpl::Program* canvasLayerProgram() const { return m_canvasLayerProgram.get(); }
    133     const CCPluginLayerImpl::Program* pluginLayerProgram() const { return m_pluginLayerProgram.get(); }
    134     const CCVideoLayerImpl::RGBAProgram* videoLayerRGBAProgram() const { return m_videoLayerRGBAProgram.get(); }
    135     const CCVideoLayerImpl::YUVProgram* videoLayerYUVProgram() const { return m_videoLayerYUVProgram.get(); }
     127    const LayerChromium::BorderProgram* borderProgram();
     128    const CCHeadsUpDisplay::Program* headsUpDisplayProgram();
     129    const RenderSurfaceChromium::Program* renderSurfaceProgram();
     130    const RenderSurfaceChromium::MaskProgram* renderSurfaceMaskProgram();
     131    const LayerTilerChromium::Program* tilerProgram();
     132    const CCCanvasLayerImpl::Program* canvasLayerProgram();
     133    const CCPluginLayerImpl::Program* pluginLayerProgram();
     134    const CCVideoLayerImpl::RGBAProgram* videoLayerRGBAProgram();
     135    const CCVideoLayerImpl::YUVProgram* videoLayerYUVProgram();
    136136
    137137    void resizeOnscreenContent(const IntSize&);
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp

    r86808 r88835  
    3232#include "Extensions3DChromium.h"
    3333#include "GraphicsContext3D.h"
     34#include "TraceEvent.h"
    3435
    3536namespace WebCore {
     
    6768                                                 GraphicsContext3D* context)
    6869{
     70    TRACE_EVENT("LayerTextureSubImage::uploadWithTexSubImage", this, 0);
    6971    if (!m_subImage)
    7072        m_subImage = adoptArrayPtr(new uint8_t[m_subImageSize.width() * m_subImageSize.height() * 4]);
     
    9395                                                    GraphicsContext3D* context)
    9496{
     97    TRACE_EVENT("LayerTextureSubImage::uploadWithMapTexSubImage", this, 0);
    9598    // Offset from image-rect to source-rect.
    9699    IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y());
  • trunk/Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp

    r79043 r88835  
    3434#include "GraphicsContext3D.h"
    3535#include "LayerRendererChromium.h"
     36#include "TraceEvent.h"
    3637
    3738namespace WebCore {
     
    5051}
    5152
    52 bool ProgramBindingBase::init(const String& vertexShader, const String& fragmentShader)
     53void ProgramBindingBase::init(const String& vertexShader, const String& fragmentShader)
    5354{
    5455    m_program = createShaderProgram(vertexShader, fragmentShader);
    55     if (!m_program) {
    56         LOG_ERROR("Failed to create shader program");
    57         return false;
    58     }
    59     return true;
     56    ASSERT(m_program);
    6057}
    6158
     
    6865    GLC(m_context, m_context->shaderSource(shader, sourceString));
    6966    GLC(m_context, m_context->compileShader(shader));
     67#ifndef NDEBUG
    7068    int compiled = 0;
    7169    GLC(m_context, m_context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compiled));
     
    7472        return 0;
    7573    }
     74#endif
    7675    return shader;
    7776}
     
    7978unsigned ProgramBindingBase::createShaderProgram(const String& vertexShaderSource, const String& fragmentShaderSource)
    8079{
     80    TRACE_EVENT("ProgramBindingBase::createShaderProgram", this, 0);
    8181    unsigned vertexShader = loadShader(GraphicsContext3D::VERTEX_SHADER, vertexShaderSource);
    8282    if (!vertexShader) {
     
    106106
    107107    GLC(m_context, m_context->linkProgram(programObject));
     108#ifndef NDEBUG
    108109    int linked = 0;
    109110    GLC(m_context, m_context->getProgramiv(programObject, GraphicsContext3D::LINK_STATUS, &linked));
     
    113114        return 0;
    114115    }
     116#endif
    115117
    116118    GLC(m_context, m_context->deleteShader(vertexShader));
  • trunk/Source/WebCore/platform/graphics/chromium/ProgramBinding.h

    r79043 r88835  
    3030
    3131#include "PlatformString.h"
     32#include "TraceEvent.h"
    3233
    3334namespace WebCore {
     
    4041    ~ProgramBindingBase();
    4142
    42     bool init(const String& vertexShader, const String& fragmentShader);
     43    void init(const String& vertexShader, const String& fragmentShader);
    4344
    4445    unsigned program() const { return m_program; }
     
    6162        : ProgramBindingBase(context)
    6263    {
    63         if (!ProgramBindingBase::init(m_vertexShader.getShaderString(), m_fragmentShader.getShaderString()))
    64             return;
    65         if (!m_vertexShader.init(m_context, m_program))
    66             return;
    67         if (!m_fragmentShader.init(m_context, m_program))
    68             return;
     64        ProgramBindingBase::init(m_vertexShader.getShaderString(), m_fragmentShader.getShaderString());
     65    }
     66
     67    void initialize()
     68    {
     69        m_vertexShader.init(m_context, m_program);
     70        m_fragmentShader.init(m_context, m_program);
    6971        m_initialized = true;
    7072    }
  • trunk/Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp

    r81414 r88835  
    4343}
    4444
    45 bool VertexShaderPosTex::init(GraphicsContext3D* context, unsigned program)
     45void VertexShaderPosTex::init(GraphicsContext3D* context, unsigned program)
    4646{
    4747    m_matrixLocation = context->getUniformLocation(program, "matrix");
    48     return m_matrixLocation != -1;
     48    ASSERT(m_matrixLocation != -1);
    4949}
    5050
     
    7171}
    7272
    73 bool VertexShaderPosTexYUVStretch::init(GraphicsContext3D* context, unsigned program)
     73void VertexShaderPosTexYUVStretch::init(GraphicsContext3D* context, unsigned program)
    7474{
    7575    m_matrixLocation = context->getUniformLocation(program, "matrix");
    7676    m_yWidthScaleFactorLocation = context->getUniformLocation(program, "y_widthScaleFactor");
    7777    m_uvWidthScaleFactorLocation = context->getUniformLocation(program, "uv_widthScaleFactor");
    78     return m_matrixLocation != -1 && m_yWidthScaleFactorLocation != -1 && m_uvWidthScaleFactorLocation != -1;
     78    ASSERT(m_matrixLocation != -1 && m_yWidthScaleFactorLocation != -1 && m_uvWidthScaleFactorLocation != -1);
    7979}
    8080
     
    104104}
    105105
    106 bool VertexShaderPos::init(GraphicsContext3D* context, unsigned program)
     106void VertexShaderPos::init(GraphicsContext3D* context, unsigned program)
    107107{
    108108    m_matrixLocation = context->getUniformLocation(program, "matrix");
    109     return m_matrixLocation != -1;
     109    ASSERT(m_matrixLocation != -1);
    110110}
    111111
     
    128128}
    129129
    130 bool VertexShaderPosTexTransform::init(GraphicsContext3D* context, unsigned program)
     130void VertexShaderPosTexTransform::init(GraphicsContext3D* context, unsigned program)
    131131{
    132132    m_matrixLocation = context->getUniformLocation(program, "matrix");
    133133    m_texTransformLocation = context->getUniformLocation(program, "texTransform");
    134     return m_matrixLocation != -1 && m_texTransformLocation != -1;
     134    ASSERT(m_matrixLocation != -1 && m_texTransformLocation != -1);
    135135}
    136136
     
    157157}
    158158
    159 bool FragmentTexAlphaBinding::init(GraphicsContext3D* context, unsigned program)
     159void FragmentTexAlphaBinding::init(GraphicsContext3D* context, unsigned program)
    160160{
    161161    m_samplerLocation = context->getUniformLocation(program, "s_texture");
    162162    m_alphaLocation = context->getUniformLocation(program, "alpha");
    163163
    164     return m_samplerLocation != -1 && m_alphaLocation != -1;
     164    ASSERT(m_samplerLocation != -1 && m_alphaLocation != -1);
    165165}
    166166
     
    217217}
    218218
    219 bool FragmentShaderRGBATexAlphaMask::init(GraphicsContext3D* context, unsigned program)
     219void FragmentShaderRGBATexAlphaMask::init(GraphicsContext3D* context, unsigned program)
    220220{
    221221    m_samplerLocation = context->getUniformLocation(program, "s_texture");
    222222    m_maskSamplerLocation = context->getUniformLocation(program, "s_mask");
    223223    m_alphaLocation = context->getUniformLocation(program, "alpha");
    224 
    225     return m_samplerLocation != -1 && m_maskSamplerLocation != -1 && m_alphaLocation != -1;
     224    ASSERT(m_samplerLocation != -1 && m_maskSamplerLocation != -1 && m_alphaLocation != -1);
    226225}
    227226
     
    253252}
    254253
    255 bool FragmentShaderYUVVideo::init(GraphicsContext3D* context, unsigned program)
     254void FragmentShaderYUVVideo::init(GraphicsContext3D* context, unsigned program)
    256255{
    257256    m_yTextureLocation = context->getUniformLocation(program, "y_texture");
     
    262261    m_yuvAdjLocation = context->getUniformLocation(program, "yuv_adj");
    263262
    264     return m_yTextureLocation != -1 && m_uTextureLocation != -1 && m_vTextureLocation != -1
    265            && m_alphaLocation != -1 && m_ccMatrixLocation != -1 && m_yuvAdjLocation != -1;
     263    ASSERT(m_yTextureLocation != -1 && m_uTextureLocation != -1 && m_vTextureLocation != -1
     264           && m_alphaLocation != -1 && m_ccMatrixLocation != -1 && m_yuvAdjLocation != -1);
    266265}
    267266
     
    296295}
    297296
    298 bool FragmentShaderColor::init(GraphicsContext3D* context, unsigned program)
     297void FragmentShaderColor::init(GraphicsContext3D* context, unsigned program)
    299298{
    300299    m_colorLocation = context->getUniformLocation(program, "color");
    301     return m_colorLocation != -1;
     300    ASSERT(m_colorLocation != -1);
    302301}
    303302
  • trunk/Source/WebCore/platform/graphics/chromium/ShaderChromium.h

    r81414 r88835  
    4343    VertexShaderPosTex();
    4444
    45     bool init(GraphicsContext3D*, unsigned program);
     45    void init(GraphicsContext3D*, unsigned program);
    4646    String getShaderString() const;
    4747
     
    5656    VertexShaderPosTexYUVStretch();
    5757
    58     bool init(GraphicsContext3D*, unsigned program);
     58    void init(GraphicsContext3D*, unsigned program);
    5959    String getShaderString() const;
    6060
     
    7373    VertexShaderPos();
    7474
    75     bool init(GraphicsContext3D*, unsigned program);
     75    void init(GraphicsContext3D*, unsigned program);
    7676    String getShaderString() const;
    7777
     
    8686    VertexShaderPosTexTransform();
    8787
    88     bool init(GraphicsContext3D*, unsigned program);
     88    void init(GraphicsContext3D*, unsigned program);
    8989    String getShaderString() const;
    9090
     
    101101    FragmentTexAlphaBinding();
    102102
    103     bool init(GraphicsContext3D*, unsigned program);
     103    void init(GraphicsContext3D*, unsigned program);
    104104    int alphaLocation() const { return m_alphaLocation; }
    105105    int samplerLocation() const { return m_samplerLocation; }
     
    130130    String getShaderString() const;
    131131
    132     bool init(GraphicsContext3D*, unsigned program);
     132    void init(GraphicsContext3D*, unsigned program);
    133133    int alphaLocation() const { return m_alphaLocation; }
    134134    int samplerLocation() const { return m_samplerLocation; }
     
    152152    String getShaderString() const;
    153153
    154     bool init(GraphicsContext3D*, unsigned program);
     154    void init(GraphicsContext3D*, unsigned program);
    155155
    156156    int yTextureLocation() const { return m_yTextureLocation; }
     
    175175    String getShaderString() const;
    176176
    177     bool init(GraphicsContext3D*, unsigned program);
     177    void init(GraphicsContext3D*, unsigned program);
    178178    int colorLocation() const { return m_colorLocation; }
    179179
  • trunk/Source/WebKit/chromium/ChangeLog

    r88812 r88835  
     12011-06-14  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Stephen White.
     4
     5        [chromium] Compositor shader initialization is inefficient
     6        https://bugs.webkit.org/show_bug.cgi?id=62618
     7
     8        Add a TRACE_EVENT() around initial compositor initialization.
     9
     10        * src/WebViewImpl.cpp:
     11        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
     12
    1132011-06-14  Adam Barth  <abarth@webkit.org>
    214
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r88582 r88835  
    24982498        m_client->didActivateAcceleratedCompositing(true);
    24992499    } else {
     2500        TRACE_EVENT("WebViewImpl::setIsAcceleratedCompositingActive(true)", this, 0);
    25002501        RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release();
    25012502        if (!context) {
Note: See TracChangeset for help on using the changeset viewer.