Changeset 80482 in webkit


Ignore:
Timestamp:
Mar 7, 2011 11:37:35 AM (13 years ago)
Author:
jamesr@google.com
Message:

2011-03-07 James Robinson <jamesr@chromium.org>

Reviewed by Kenneth Russell.

[chromium] Separate the update and draw portions of LayerRendererChromium's drawLayers function
https://bugs.webkit.org/show_bug.cgi?id=54047

This splits up LayerRendererChromium::drawLayers() into two phases,
one that updates layers and one that actually draws them. Most of the
patch is moving the bodies of drawLayers() and updateLayersRecursive()
into smaller helper functions.

The main entry point is renamed updateAndDrawLayers(), but otherwise
has the same signature as drawLayers() did. Internally it does the
following:

1.) Updates the root layer's contents
2.) Updates the root layer's scrollbars
3.) Updates the RenderSurface tree and the contents of all child
layers
4.) Draws the root layer and root layer scrollbars
5.) Draws all child layers using the previously updated
CCLayerImpl/RenderSurface data.

A few things still need to be done after this patch to complete the separation
of the update and draw step, but they can happen in later patches:
*) The root layer and root layer scrollbars contents should be
uploaded to textures at draw time, not update time.
*) The RenderSurface tree should be updated at draw time, not update
time.

Covered by the compositing/ tests.

  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::LayerRendererChromium): (WebCore::LayerRendererChromium::updateRootLayerContents): (WebCore::LayerRendererChromium::updateRootLayerScrollbars): (WebCore::LayerRendererChromium::drawRootLayer): (WebCore::LayerRendererChromium::updateAndDrawLayers): (WebCore::LayerRendererChromium::updateLayers): (WebCore::LayerRendererChromium::drawLayers): (WebCore::LayerRendererChromium::getFramebufferPixels): (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces): (WebCore::LayerRendererChromium::updateContentsRecursive): (WebCore::LayerRendererChromium::drawLayer):
  • platform/graphics/chromium/LayerRendererChromium.h: (WebCore::LayerRendererChromium::visibleRectSize):
  • platform/graphics/chromium/RenderSurfaceChromium.cpp: (WebCore::RenderSurfaceChromium::drawSurface):
  • platform/graphics/chromium/cc/CCLayerImpl.cpp:
  • platform/graphics/chromium/cc/CCLayerImpl.h:

2011-03-07 James Robinson <jamesr@chromium.org>

Reviewed by Kenneth Russell.

[chromium] Separate the &quot;update&quot; and &quot;draw&quot; portions of LayerRendererChromium&apos;s drawLayers function
https://bugs.webkit.org/show_bug.cgi?id=54047

Call updated LayerRendererChromium APIs.

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::doPixelReadbackToCanvas): (WebKit::WebViewImpl::paint): (WebKit::WebViewImpl::doComposite):
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80481 r80482  
     12011-03-07  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        [chromium] Separate the update and draw portions of LayerRendererChromium's drawLayers function
     6        https://bugs.webkit.org/show_bug.cgi?id=54047
     7
     8        This splits up LayerRendererChromium::drawLayers() into two phases,
     9        one that updates layers and one that actually draws them.  Most of the
     10        patch is moving the bodies of drawLayers() and updateLayersRecursive()
     11        into smaller helper functions.
     12
     13        The main entry point is renamed updateAndDrawLayers(), but otherwise
     14        has the same signature as drawLayers() did.  Internally it does the
     15        following:
     16
     17        1.) Updates the root layer's contents
     18        2.) Updates the root layer's scrollbars
     19        3.) Updates the RenderSurface tree and the contents of all child
     20        layers
     21        4.) Draws the root layer and root layer scrollbars
     22        5.) Draws all child layers using the previously updated
     23        CCLayerImpl/RenderSurface data.
     24
     25        A few things still need to be done after this patch to complete the separation
     26        of the update and draw step, but they can happen in later patches:
     27        *) The root layer and root layer scrollbars contents should be
     28        uploaded to textures at draw time, not update time.
     29        *) The RenderSurface tree should be updated at draw time, not update
     30        time.
     31
     32        Covered by the compositing/ tests.
     33
     34        * platform/graphics/chromium/LayerRendererChromium.cpp:
     35        (WebCore::LayerRendererChromium::LayerRendererChromium):
     36        (WebCore::LayerRendererChromium::updateRootLayerContents):
     37        (WebCore::LayerRendererChromium::updateRootLayerScrollbars):
     38        (WebCore::LayerRendererChromium::drawRootLayer):
     39        (WebCore::LayerRendererChromium::updateAndDrawLayers):
     40        (WebCore::LayerRendererChromium::updateLayers):
     41        (WebCore::LayerRendererChromium::drawLayers):
     42        (WebCore::LayerRendererChromium::getFramebufferPixels):
     43        (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces):
     44        (WebCore::LayerRendererChromium::updateContentsRecursive):
     45        (WebCore::LayerRendererChromium::drawLayer):
     46        * platform/graphics/chromium/LayerRendererChromium.h:
     47        (WebCore::LayerRendererChromium::visibleRectSize):
     48        * platform/graphics/chromium/RenderSurfaceChromium.cpp:
     49        (WebCore::RenderSurfaceChromium::drawSurface):
     50        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
     51        * platform/graphics/chromium/cc/CCLayerImpl.h:
     52
    1532011-03-07  Adam Barth  <abarth@webkit.org>
    254
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r80404 r80482  
    3535#include "LayerRendererChromium.h"
    3636
     37#include "cc/CCLayerImpl.h"
    3738#include "Canvas2DLayerChromium.h"
    3839#include "GeometryBinding.h"
     
    104105
    105106LayerRendererChromium::LayerRendererChromium(PassRefPtr<GraphicsContext3D> context)
    106     : m_rootLayerTextureWidth(0)
    107     , m_rootLayerTextureHeight(0)
    108     , m_rootLayer(0)
     107    : m_rootLayer(0)
    109108    , m_scrollPosition(IntPoint(-1, -1))
    110109    , m_currentShader(0)
     
    179178}
    180179
    181 void LayerRendererChromium::updateAndDrawRootLayer(TilePaintInterface& tilePaint, TilePaintInterface& scrollbarPaint, const IntRect& visibleRect, const IntRect& contentRect)
     180void LayerRendererChromium::updateRootLayerContents(TilePaintInterface& tilePaint, const IntRect& visibleRect)
    182181{
    183182    m_rootLayerTiler->update(tilePaint, visibleRect);
    184     m_rootLayerTiler->draw(visibleRect);
    185 
     183}
     184
     185void LayerRendererChromium::updateRootLayerScrollbars(TilePaintInterface& scrollbarPaint, const IntRect& visibleRect, const IntRect& contentRect)
     186{
    186187    if (visibleRect.width() > contentRect.width()) {
    187188        IntRect verticalScrollbar = verticalScrollbarRect(visibleRect, contentRect);
     
    193194        m_verticalScrollbarTiler->setLayerPosition(verticalScrollbar.location());
    194195        m_verticalScrollbarTiler->update(scrollbarPaint, visibleRect);
    195         m_verticalScrollbarTiler->draw(visibleRect);
    196     }
     196    } else
     197        m_verticalScrollbarTiler.clear();
    197198
    198199    if (visibleRect.height() > contentRect.height()) {
     
    205206        m_horizontalScrollbarTiler->setLayerPosition(horizontalScrollbar.location());
    206207        m_horizontalScrollbarTiler->update(scrollbarPaint, visibleRect);
    207         m_horizontalScrollbarTiler->draw(visibleRect);
    208     }
    209 }
    210 
    211 void LayerRendererChromium::drawLayers(const IntRect& visibleRect, const IntRect& contentRect,
    212                                        const IntPoint& scrollPosition, TilePaintInterface& tilePaint,
    213                                        TilePaintInterface& scrollbarPaint)
     208    } else
     209        m_horizontalScrollbarTiler.clear();
     210}
     211
     212void LayerRendererChromium::drawRootLayer()
     213{
     214    m_rootLayerTiler->draw(m_visibleRect);
     215
     216    if (m_verticalScrollbarTiler)
     217        m_verticalScrollbarTiler->draw(m_visibleRect);
     218
     219    if (m_horizontalScrollbarTiler)
     220        m_horizontalScrollbarTiler->draw(m_visibleRect);
     221}
     222
     223void LayerRendererChromium::updateAndDrawLayers(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition,
     224                                                TilePaintInterface& tilePaint, TilePaintInterface& scrollbarPaint)
    214225{
    215226    ASSERT(m_hardwareCompositing);
     
    218229        return;
    219230
    220     makeContextCurrent();
     231    updateRootLayerContents(tilePaint, visibleRect);
     232    // Recheck that we still have a root layer. This may become null if
     233    // compositing gets turned off during a paint operation.
     234    if (!m_rootLayer)
     235        return;
     236
     237    updateRootLayerScrollbars(scrollbarPaint, visibleRect, contentRect);
     238
     239    Vector<CCLayerImpl*> renderSurfaceLayerList;
     240    updateLayers(visibleRect, contentRect, scrollPosition, renderSurfaceLayerList);
     241
     242    drawLayers(renderSurfaceLayerList);
     243}
     244
     245void LayerRendererChromium::updateLayers(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition,
     246                                         Vector<CCLayerImpl*>& renderSurfaceLayerList)
     247{
     248    CCLayerImpl* rootDrawLayer = m_rootLayer->ccLayerImpl();
     249
     250    if (!rootDrawLayer->renderSurface())
     251        rootDrawLayer->createRenderSurface();
     252    ASSERT(rootDrawLayer->renderSurface());
    221253
    222254    // If the size of the visible area has changed then allocate a new texture
    223255    // to store the contents of the root layer and adjust the projection matrix
    224256    // and viewport.
    225     int visibleRectWidth = visibleRect.width();
    226     int visibleRectHeight = visibleRect.height();
    227 
    228     if (!m_rootLayer->ccLayerImpl()->renderSurface())
    229         m_rootLayer->ccLayerImpl()->createRenderSurface();
    230     m_rootLayer->ccLayerImpl()->renderSurface()->m_contentRect = IntRect(0, 0, visibleRectWidth, visibleRectHeight);
    231 
    232     if (visibleRectWidth != m_rootLayerTextureWidth || visibleRectHeight != m_rootLayerTextureHeight) {
    233         m_rootLayerTextureWidth = visibleRectWidth;
    234         m_rootLayerTextureHeight = visibleRectHeight;
    235 
     257
     258    rootDrawLayer->renderSurface()->m_contentRect = IntRect(IntPoint(0, 0), visibleRect.size());
     259
     260    if (visibleRect.size() != m_visibleRect.size()) {
    236261        // Reset the current render surface to force an update of the viewport and
    237262        // projection matrix next time useRenderSurface is called.
    238263        m_currentRenderSurface = 0;
    239264    }
     265    m_visibleRect = visibleRect;
     266
     267    m_scrollPosition = scrollPosition;
     268    // Scissor out the scrollbars to avoid rendering on top of them.
     269    IntRect rootScissorRect(contentRect);
     270    // The scissorRect should not include the scroll offset.
     271    rootScissorRect.move(-m_scrollPosition.x(), -m_scrollPosition.y());
     272    rootDrawLayer->setScissorRect(rootScissorRect);
     273
     274    m_defaultRenderSurface = rootDrawLayer->renderSurface();
     275
     276    renderSurfaceLayerList.append(rootDrawLayer);
     277
     278    TransformationMatrix identityMatrix;
     279    m_defaultRenderSurface->m_layerList.clear();
     280    // Unfortunately, updatePropertiesAndRenderSurfaces() currently both updates the layers and updates the draw state
     281    // (transforms, etc). It'd be nicer if operations on the presentation layers happened later, but the draw
     282    // transforms are needed by large layers to determine visibility. Tiling will fix this by eliminating the
     283    // concept of a large content layer.
     284    updatePropertiesAndRenderSurfaces(m_rootLayer.get(), identityMatrix, renderSurfaceLayerList, m_defaultRenderSurface->m_layerList);
     285
     286    updateContentsRecursive(m_rootLayer.get());
     287}
     288
     289void LayerRendererChromium::drawLayers(const Vector<CCLayerImpl*>& renderSurfaceLayerList)
     290{
     291    CCLayerImpl* rootDrawLayer = m_rootLayer->ccLayerImpl();
     292    makeContextCurrent();
    240293
    241294    // The GL viewport covers the entire visible area, including the scrollbars.
    242     GLC(m_context.get(), m_context->viewport(0, 0, visibleRectWidth, visibleRectHeight));
     295    GLC(m_context.get(), m_context->viewport(0, 0, m_visibleRect.width(), m_visibleRect.height()));
    243296
    244297    // Bind the common vertex attributes used for drawing all the layers.
     
    251304    // Blending disabled by default. Root layer alpha channel on Windows is incorrect when Skia uses ClearType.
    252305    GLC(m_context.get(), m_context->disable(GraphicsContext3D::BLEND));
    253 
    254     m_scrollPosition = scrollPosition;
    255 
    256     ASSERT(m_rootLayer->ccLayerImpl()->renderSurface());
    257     m_defaultRenderSurface = m_rootLayer->ccLayerImpl()->renderSurface();
    258306
    259307    useRenderSurface(m_defaultRenderSurface);
     
    267315    m_context->colorMask(true, true, true, false);
    268316
    269     updateAndDrawRootLayer(tilePaint, scrollbarPaint, visibleRect, contentRect);
     317    drawRootLayer();
    270318
    271319    // Re-enable color writes to layers, which may be partially transparent.
    272320    m_context->colorMask(true, true, true, true);
    273 
    274     // Recheck that we still have a root layer.  This may become null if
    275     // compositing gets turned off during a paint operation.
    276     if (!m_rootLayer)
    277         return;
    278 
    279     // Set the root visible/content rects --- used by subsequent drawLayers calls.
    280     m_rootVisibleRect = visibleRect;
    281     m_rootContentRect = contentRect;
    282 
    283     // Scissor out the scrollbars to avoid rendering on top of them.
    284     IntRect rootScissorRect(contentRect);
    285     // The scissorRect should not include the scroll offset.
    286     rootScissorRect.move(-m_scrollPosition.x(), -m_scrollPosition.y());
    287     m_rootLayer->ccLayerImpl()->setScissorRect(rootScissorRect);
    288 
    289     Vector<CCLayerImpl*> renderSurfaceLayerList;
    290     renderSurfaceLayerList.append(m_rootLayer->ccLayerImpl());
    291 
    292     TransformationMatrix identityMatrix;
    293     m_defaultRenderSurface->m_layerList.clear();
    294     updateLayersRecursive(m_rootLayer.get(), identityMatrix, renderSurfaceLayerList, m_defaultRenderSurface->m_layerList);
    295321
    296322    GLC(m_context.get(), m_context->enable(GraphicsContext3D::BLEND));
     
    310336
    311337        if (useRenderSurface(renderSurfaceLayer->renderSurface())) {
    312             if (renderSurfaceLayer != m_rootLayer->ccLayerImpl()) {
     338            if (renderSurfaceLayer != rootDrawLayer) {
    313339                GLC(m_context.get(), m_context->disable(GraphicsContext3D::SCISSOR_TEST));
    314340                GLC(m_context.get(), m_context->clearColor(0, 0, 0, 0));
     
    366392void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect)
    367393{
    368     ASSERT(rect.maxX() <= rootLayerTextureSize().width()
    369            && rect.maxY() <= rootLayerTextureSize().height());
     394    ASSERT(rect.maxX() <= visibleRectSize().width() && rect.maxY() <= visibleRectSize().height());
    370395
    371396    if (!pixels)
     
    420445// Recursively walks the layer tree starting at the given node and computes all the
    421446// necessary transformations, scissor rectangles, render surfaces, etc.
    422 void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList)
     447void LayerRendererChromium::updatePropertiesAndRenderSurfaces(LayerChromium* layer, const TransformationMatrix& parentMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList)
    423448{
    424449    layer->setLayerRenderer(this);
     
    476501    bool useSurfaceForClipping = layer->masksToBounds() && !isScaleOrTranslation(combinedTransform);
    477502    bool useSurfaceForOpacity = layer->opacity() != 1 && !layer->preserves3D();
    478     bool useSurfaceForMasking = layer->maskLayer();
     503    bool useSurfaceForMasking = layer->maskDrawLayer();
    479504    bool useSurfaceForReflection = layer->replicaLayer();
    480505    if (((useSurfaceForClipping || useSurfaceForOpacity) && layer->descendantsDrawContent())
     
    485510
    486511        // The origin of the new surface is the upper left corner of the layer.
    487         TransformationMatrix drawTransform;;
     512        TransformationMatrix drawTransform;
    488513        drawTransform.translate3d(0.5 * bounds.width(), 0.5 * bounds.height(), 0);
    489514        drawLayer->setDrawTransform(drawTransform);
     
    493518        // Layer's opacity will be applied when drawing the render surface.
    494519        renderSurface->m_drawOpacity = layer->opacity();
    495         if (layer->superlayer()->preserves3D())
     520        if (layer->superlayer() && layer->superlayer()->preserves3D())
    496521            renderSurface->m_drawOpacity *= drawLayer->superlayer()->drawOpacity();
    497522        drawLayer->setDrawOpacity(1);
     
    510535        // be applied before drawing the render surface onto its containing
    511536        // surface and is therefore expressed in the superlayer's coordinate system.
    512         renderSurface->m_scissorRect = drawLayer->superlayer()->scissorRect();
     537        renderSurface->m_scissorRect = drawLayer->superlayer() ? drawLayer->superlayer()->scissorRect() : drawLayer->scissorRect();
    513538
    514539        renderSurface->m_layerList.clear();
     
    561586    }
    562587
    563     // m_drawableContentRect is always stored in the coordinate system of the
     588    // drawableContentRect() is always stored in the coordinate system of the
    564589    // RenderSurface the layer draws into.
    565590    if (drawLayer->drawsContent())
     
    596621    for (size_t i = 0; i < sublayers.size(); ++i) {
    597622        CCLayerImpl* sublayer = sublayers[i]->ccLayerImpl();
    598         updateLayersRecursive(sublayers[i].get(), sublayerMatrix, renderSurfaceLayerList, descendants);
     623        updatePropertiesAndRenderSurfaces(sublayers[i].get(), sublayerMatrix, renderSurfaceLayerList, descendants);
    599624
    600625        if (sublayer->renderSurface()) {
     
    624649        // Restrict the RenderSurface size to the portion that's visible.
    625650        FloatSize centerOffsetDueToClipping;
     651
    626652        // Don't clip if the layer is reflected as the reflection shouldn't be
    627653        // clipped.
     
    676702}
    677703
     704void LayerRendererChromium::updateContentsRecursive(LayerChromium* layer)
     705{
     706    const Vector<RefPtr<LayerChromium> >& sublayers = layer->getSublayers();
     707    for (size_t i = 0; i < sublayers.size(); ++i)
     708        updateContentsRecursive(sublayers[i].get());
     709
     710    if (layer->drawsContent())
     711        layer->updateContentsIfDirty();
     712    if (layer->maskLayer() && layer->maskLayer()->drawsContent())
     713        layer->maskLayer()->updateContentsIfDirty();
     714    if (layer->replicaLayer() && layer->replicaLayer()->drawsContent())
     715        layer->replicaLayer()->updateContentsIfDirty();
     716    if (layer->replicaLayer() && layer->replicaLayer()->maskLayer() && layer->replicaLayer()->maskLayer()->drawsContent())
     717        layer->replicaLayer()->maskLayer()->updateContentsIfDirty();
     718}
     719
    678720void LayerRendererChromium::setCompositeOffscreen(bool compositeOffscreen)
    679721{
     
    764806         return;
    765807
    766     if (layer->drawsContent()) {
    767         layer->updateContentsIfDirty();
    768         m_context->makeContextCurrent();
     808    if (layer->drawsContent())
    769809        layer->draw();
    770     }
    771810
    772811    // Draw the debug border if there is one.
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r80327 r80482  
    7676
    7777    // updates and draws the current layers onto the backbuffer
    78     void drawLayers(const IntRect& visibleRect, const IntRect& contentRect,
    79                     const IntPoint& scrollPosition, TilePaintInterface& tilePaint,
    80                     TilePaintInterface& scrollbarPaint);
     78    void updateAndDrawLayers(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition,
     79                             TilePaintInterface&, TilePaintInterface& scrollbarPaint);
    8180
    8281    // waits for rendering to finish
     
    8584    // puts backbuffer onscreen
    8685    void present();
     86
     87    IntSize visibleRectSize() const { return m_visibleRect.size(); }
    8788
    8889    void setRootLayer(PassRefPtr<LayerChromium> layer);
     
    121122    void resizeOnscreenContent(const IntSize&);
    122123
    123     IntSize rootLayerTextureSize() const { return IntSize(m_rootLayerTextureWidth, m_rootLayerTextureHeight); }
    124     IntRect rootLayerContentRect() const { return m_rootContentRect; }
    125124    void getFramebufferPixels(void *pixels, const IntRect& rect);
    126125
     
    128127
    129128    CCHeadsUpDisplay* headsUpDisplay() { return m_headsUpDisplay.get(); }
    130     IntRect rootVisibleRect() const { return m_rootVisibleRect; }
    131129
    132130    void setScissorToRect(const IntRect&);
     
    136134private:
    137135    explicit LayerRendererChromium(PassRefPtr<GraphicsContext3D> graphicsContext3D);
    138     void updateLayersRecursive(LayerChromium*, const TransformationMatrix& parentMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList);
    139 
     136
     137    void updateLayers(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition,
     138                     Vector<CCLayerImpl*>& renderSurfaceLayerList);
     139    void updateRootLayerContents(TilePaintInterface&, const IntRect& visibleRect);
     140    void updateRootLayerScrollbars(TilePaintInterface& scrollbarPaint, const IntRect& visibleRect, const IntRect& contentRect);
     141    void updatePropertiesAndRenderSurfaces(LayerChromium*, const TransformationMatrix& parentMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList);
     142    void updateContentsRecursive(LayerChromium*);
     143
     144    void drawLayers(const Vector<CCLayerImpl*>& renderSurfaceLayerList);
    140145    void drawLayer(CCLayerImpl*, RenderSurfaceChromium*);
    141146
    142     void updateAndDrawRootLayer(TilePaintInterface& tilePaint, TilePaintInterface& scrollbarPaint, const IntRect& visibleRect, const IntRect& contentRect);
     147    void drawRootLayer();
    143148
    144149    bool isLayerVisible(LayerChromium*, const TransformationMatrix&, const IntRect& visibleRect);
     
    160165    static IntRect horizontalScrollbarRect(const IntRect& visibleRect, const IntRect& contentRect);
    161166
    162     int m_rootLayerTextureWidth;
    163     int m_rootLayerTextureHeight;
     167    IntRect m_visibleRect;
    164168
    165169    TransformationMatrix m_projectionMatrix;
     
    188192    OwnPtr<GraphicsContext> m_rootLayerGraphicsContext;
    189193#endif
    190 
    191     IntRect m_rootVisibleRect;
    192     IntRect m_rootContentRect;
    193194
    194195    // Maximum texture dimensions supported.
  • trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp

    r80327 r80482  
    110110    bool useMask = false;
    111111    if (maskLayer && maskLayer->drawsContent()) {
    112         maskLayer->updateContentsIfDirty();
    113112        if (!maskLayer->bounds().isEmpty()) {
    114113            context3D->makeContextCurrent();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp

    r80327 r80482  
    6767    IntSize hudSize;
    6868    if (m_showPlatformLayerTree) {
    69         hudSize.setWidth(min(2048, m_layerRenderer->rootVisibleRect().width()));
    70         hudSize.setHeight(min(2048, m_layerRenderer->rootVisibleRect().height()));
     69        hudSize.setWidth(min(2048, m_layerRenderer->visibleRectSize().width()));
     70        hudSize.setHeight(min(2048, m_layerRenderer->visibleRectSize().height()));
    7171    } else {
    7272        hudSize.setWidth(512);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r80327 r80482  
    108108}
    109109
    110 // This does not belong on CCLayerImpl.
    111 void CCLayerImpl::updateContentsIfDirty()
    112 {
    113     m_owner->updateContentsIfDirty();
    114 }
    115 
    116110// These belong on CCLayerImpl, but should be subclased by each type and not defer to the LayerChromium subtypes.
    117111bool CCLayerImpl::drawsContent() const
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h

    r80327 r80482  
    6060    CCLayerImpl* replicaLayer() const;
    6161
    62     void updateContentsIfDirty();
    6362    void draw();
    6463    bool drawsContent() const;
  • trunk/Source/WebKit/chromium/ChangeLog

    r80475 r80482  
     12011-03-07  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        [chromium] Separate the &quot;update&quot; and &quot;draw&quot; portions of LayerRendererChromium&apos;s drawLayers function
     6        https://bugs.webkit.org/show_bug.cgi?id=54047
     7
     8        Call updated LayerRendererChromium APIs.
     9
     10        * src/WebViewImpl.cpp:
     11        (WebKit::WebViewImpl::doPixelReadbackToCanvas):
     12        (WebKit::WebViewImpl::paint):
     13        (WebKit::WebViewImpl::doComposite):
     14
    1152011-03-07  Sam Weinig  <sam@webkit.org>
    216
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r80474 r80482  
    10161016void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect)
    10171017{
    1018     ASSERT(rect.maxX() <= m_layerRenderer->rootLayerTextureSize().width()
    1019            && rect.maxY() <= m_layerRenderer->rootLayerTextureSize().height());
    1020 
    10211018#if USE(SKIA)
    10221019    PlatformContextSkia context(canvas);
     
    10611058            // Clip rect to the confines of the rootLayerTexture.
    10621059            IntRect resizeRect(rect);
    1063             resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->rootLayerTextureSize()));
     1060            resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->visibleRectSize()));
    10641061            doPixelReadbackToCanvas(canvas, resizeRect);
    10651062        }
     
    24092406    hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree());
    24102407
    2411     m_layerRenderer->drawLayers(visibleRect, contentRect, scroll, tilePaint, scrollbarPaint);
     2408    m_layerRenderer->updateAndDrawLayers(visibleRect, contentRect, scroll, tilePaint, scrollbarPaint);
     2409
    24122410    if (m_layerRenderer->isCompositingOffscreen())
    24132411        m_layerRenderer->copyOffscreenTextureToDisplay();
Note: See TracChangeset for help on using the changeset viewer.