Changeset 123553 in webkit


Ignore:
Timestamp:
Jul 24, 2012 5:25:53 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Add time spent painting to GPU benchmarking renderingStats() API.
https://bugs.webkit.org/show_bug.cgi?id=90019

Patch by Dave Tu <dtu@chromium.org> on 2012-07-24
Reviewed by Adrienne Walker.

Source/Platform:

  • chromium/public/WebRenderingStats.h:

(WebRenderingStats):
(WebKit::WebRenderingStats::WebRenderingStats):

Source/WebCore:

  • platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:

(WebCore::BitmapCanvasLayerTextureUpdater::prepareToUpdate):

  • platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:

(BitmapCanvasLayerTextureUpdater):

  • platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:

(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect):
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::prepareToUpdate):
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect):

  • platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:

(Texture):
(BitmapSkPictureCanvasLayerTextureUpdater):

  • platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:

(WebCore::CanvasLayerTextureUpdater::paintContents):

  • platform/graphics/chromium/CanvasLayerTextureUpdater.h:

(CanvasLayerTextureUpdater):

  • platform/graphics/chromium/ContentLayerChromium.cpp:

(WebCore::ContentLayerChromium::update):

  • platform/graphics/chromium/ContentLayerChromium.h:

(ContentLayerChromium):

  • platform/graphics/chromium/ImageLayerChromium.cpp:

(WebCore::ImageLayerChromium::update):

  • platform/graphics/chromium/ImageLayerChromium.h:

(ImageLayerChromium):

  • platform/graphics/chromium/LayerChromium.h:

(WebCore):
(WebCore::LayerChromium::update):

  • platform/graphics/chromium/LayerTextureUpdater.h:

(WebCore):
(WebCore::LayerTextureUpdater::Texture::prepareRect):
(WebCore::LayerTextureUpdater::prepareToUpdate):

  • platform/graphics/chromium/ScrollbarLayerChromium.cpp:

(WebCore::ScrollbarLayerChromium::updatePart):
(WebCore::ScrollbarLayerChromium::update):

  • platform/graphics/chromium/ScrollbarLayerChromium.h:

(ScrollbarLayerChromium):

  • platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp:

(WebCore::SkPictureCanvasLayerTextureUpdater::prepareToUpdate):

  • platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h:

(SkPictureCanvasLayerTextureUpdater):

  • platform/graphics/chromium/TiledLayerChromium.cpp:

(WebCore::TiledLayerChromium::updateTiles):
(WebCore::TiledLayerChromium::updateContentRect):

  • platform/graphics/chromium/TiledLayerChromium.h:

(TiledLayerChromium):

  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp:

(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::updateAnimations):
(WebCore::CCLayerTreeHost::renderingStats):
(WebCore::CCLayerTreeHost::paintMasksForRenderSurface):
(WebCore::CCLayerTreeHost::paintLayerContents):

  • platform/graphics/chromium/cc/CCLayerTreeHost.h:

(WebCore):
(CCLayerTreeHost):

  • platform/graphics/chromium/cc/CCRenderingStats.h:

(CCRenderingStats):
(WebCore::CCRenderingStats::CCRenderingStats):

Source/WebKit/chromium:

  • src/WebLayerTreeView.cpp:

(WebKit::WebLayerTreeView::renderingStats):

  • tests/CCLayerTreeHostTest.cpp:
  • tests/CCTiledLayerTestCommon.cpp:

(WebKitTests::FakeLayerTextureUpdater::Texture::prepareRect):
(WebKitTests::FakeTiledLayerChromium::update):

  • tests/CCTiledLayerTestCommon.h:

(Texture):
(FakeTiledLayerChromium):

  • tests/Canvas2DLayerBridgeTest.cpp:
  • tests/ContentLayerChromiumTest.cpp:

(WebKit::TEST):

  • tests/TiledLayerChromiumTest.cpp:
Location:
trunk/Source
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/Platform/ChangeLog

    r123533 r123553  
     12012-07-24  Dave Tu  <dtu@chromium.org>
     2
     3        [chromium] Add time spent painting to GPU benchmarking renderingStats() API.
     4        https://bugs.webkit.org/show_bug.cgi?id=90019
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * chromium/public/WebRenderingStats.h:
     9        (WebRenderingStats):
     10        (WebKit::WebRenderingStats::WebRenderingStats):
     11
    1122012-07-24  Sheriff Bot  <webkit.review.bot@gmail.com>
    213
  • trunk/Source/Platform/chromium/public/WebRenderingStats.h

    r123421 r123553  
    3333    int numFramesSentToScreen;
    3434    int droppedFrameCount;
     35    double totalPaintTimeInSeconds;
     36    double totalRasterizeTimeInSeconds;
    3537
    3638    WebRenderingStats()
     
    3840        , numFramesSentToScreen(0)
    3941        , droppedFrameCount(0)
     42        , totalPaintTimeInSeconds(0)
     43        , totalRasterizeTimeInSeconds(0)
    4044    {
    4145    }
  • trunk/Source/WebCore/ChangeLog

    r123550 r123553  
     12012-07-24  Dave Tu  <dtu@chromium.org>
     2
     3        [chromium] Add time spent painting to GPU benchmarking renderingStats() API.
     4        https://bugs.webkit.org/show_bug.cgi?id=90019
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:
     9        (WebCore::BitmapCanvasLayerTextureUpdater::prepareToUpdate):
     10        * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
     11        (BitmapCanvasLayerTextureUpdater):
     12        * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
     13        (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect):
     14        (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::prepareToUpdate):
     15        (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect):
     16        * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
     17        (Texture):
     18        (BitmapSkPictureCanvasLayerTextureUpdater):
     19        * platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:
     20        (WebCore::CanvasLayerTextureUpdater::paintContents):
     21        * platform/graphics/chromium/CanvasLayerTextureUpdater.h:
     22        (CanvasLayerTextureUpdater):
     23        * platform/graphics/chromium/ContentLayerChromium.cpp:
     24        (WebCore::ContentLayerChromium::update):
     25        * platform/graphics/chromium/ContentLayerChromium.h:
     26        (ContentLayerChromium):
     27        * platform/graphics/chromium/ImageLayerChromium.cpp:
     28        (WebCore::ImageLayerChromium::update):
     29        * platform/graphics/chromium/ImageLayerChromium.h:
     30        (ImageLayerChromium):
     31        * platform/graphics/chromium/LayerChromium.h:
     32        (WebCore):
     33        (WebCore::LayerChromium::update):
     34        * platform/graphics/chromium/LayerTextureUpdater.h:
     35        (WebCore):
     36        (WebCore::LayerTextureUpdater::Texture::prepareRect):
     37        (WebCore::LayerTextureUpdater::prepareToUpdate):
     38        * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
     39        (WebCore::ScrollbarLayerChromium::updatePart):
     40        (WebCore::ScrollbarLayerChromium::update):
     41        * platform/graphics/chromium/ScrollbarLayerChromium.h:
     42        (ScrollbarLayerChromium):
     43        * platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp:
     44        (WebCore::SkPictureCanvasLayerTextureUpdater::prepareToUpdate):
     45        * platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h:
     46        (SkPictureCanvasLayerTextureUpdater):
     47        * platform/graphics/chromium/TiledLayerChromium.cpp:
     48        (WebCore::TiledLayerChromium::updateTiles):
     49        (WebCore::TiledLayerChromium::updateContentRect):
     50        * platform/graphics/chromium/TiledLayerChromium.h:
     51        (TiledLayerChromium):
     52        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     53        (WebCore::CCLayerTreeHost::CCLayerTreeHost):
     54        (WebCore::CCLayerTreeHost::updateAnimations):
     55        (WebCore::CCLayerTreeHost::renderingStats):
     56        (WebCore::CCLayerTreeHost::paintMasksForRenderSurface):
     57        (WebCore::CCLayerTreeHost::paintLayerContents):
     58        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     59        (WebCore):
     60        (CCLayerTreeHost):
     61        * platform/graphics/chromium/cc/CCRenderingStats.h:
     62        (CCRenderingStats):
     63        (WebCore::CCRenderingStats::CCRenderingStats):
     64
    1652012-07-24  Jian Li  <jianli@chromium.org>
    266
  • trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp

    r123065 r123553  
    8080}
    8181
    82 void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect)
     82void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats)
    8383{
    8484    if (m_canvasSize != contentRect.size()) {
     
    8787    }
    8888
    89     paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect);
     89    paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
    9090}
    9191
  • trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h

    r123065 r123553  
    6161    virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*);
    6262    virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat);
    63     virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect) OVERRIDE;
     63    virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats&) OVERRIDE;
    6464    void updateTextureRect(CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntRect& destRect);
    6565
  • trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp

    r123065 r123553  
    3535#include "SkCanvas.h"
    3636#include "SkDevice.h"
     37#include "cc/CCRenderingStats.h"
     38#include <wtf/CurrentTime.h>
    3739
    3840namespace WebCore {
     
    4446}
    4547
    46 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRect& sourceRect)
     48void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRect& sourceRect, CCRenderingStats& stats)
    4749{
    4850    m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRect.height());
     
    5153    SkDevice device(m_bitmap);
    5254    SkCanvas canvas(&device);
    53     textureUpdater()->paintContentsRect(&canvas, sourceRect);
     55    double paintBeginTime = monotonicallyIncreasingTime();
     56    textureUpdater()->paintContentsRect(&canvas, sourceRect, stats);
     57    stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginTime;
    5458}
    5559
     
    8892}
    8993
    90 void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect)
     94void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, CCRenderingStats& stats)
    9195{
    9296    // Translate the origin of contentRect to that of sourceRect.
    9397    canvas->translate(contentRect().x() - sourceRect.x(),
    9498                      contentRect().y() - sourceRect.y());
     99    double rasterizeBeginTime = monotonicallyIncreasingTime();
    95100    drawPicture(canvas);
     101    stats.totalRasterizeTimeInSeconds += monotonicallyIncreasingTime() - rasterizeBeginTime;
    96102}
    97103
  • trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h

    r123065 r123553  
    4242        Texture(BitmapSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<CCPrioritizedTexture>);
    4343
    44         virtual void prepareRect(const IntRect& sourceRect) OVERRIDE;
     44        virtual void prepareRect(const IntRect& sourceRect, CCRenderingStats&) OVERRIDE;
    4545        virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) OVERRIDE;
    4646
     
    5757    virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*) OVERRIDE;
    5858    virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRIDE;
    59     void paintContentsRect(SkCanvas*, const IntRect& sourceRect);
     59    void paintContentsRect(SkCanvas*, const IntRect& sourceRect, CCRenderingStats&);
    6060
    6161private:
  • trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp

    r122373 r123553  
    3838#include "SkiaUtils.h"
    3939#include "TraceEvent.h"
     40#include "cc/CCRenderingStats.h"
     41#include <wtf/CurrentTime.h>
    4042
    4143namespace WebCore {
     
    5052}
    5153
    52 void CanvasLayerTextureUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect)
     54void CanvasLayerTextureUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats)
    5355{
    5456    TRACE_EVENT0("cc", "CanvasLayerTextureUpdater::paintContents");
     
    7375
    7476    FloatRect opaqueLayerRect;
     77    double paintBeginTime = monotonicallyIncreasingTime();
    7578    m_painter->paint(canvas, layerRect, opaqueLayerRect);
     79    stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginTime;
    7680    canvas->restore();
    7781
  • trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h

    r121436 r123553  
    4848    explicit CanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>);
    4949
    50     void paintContents(SkCanvas*, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect);
     50    void paintContents(SkCanvas*, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats&);
    5151    const IntRect& contentRect() const { return m_contentRect; }
    5252
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r123065 r123553  
    9494}
    9595
    96 void ContentLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion)
     96void ContentLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats)
    9797{
    9898    createTextureUpdaterIfNeeded();
     
    105105        contentRect = visibleContentRect();
    106106
    107     updateContentRect(updater, contentRect, occlusion);
     107    updateContentRect(updater, contentRect, occlusion, stats);
    108108    m_needsDisplay = false;
    109109}
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h

    r122185 r123553  
    7878    virtual bool drawsContent() const OVERRIDE;
    7979    virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE;
    80     virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) OVERRIDE;
     80    virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE;
    8181    virtual bool needMoreUpdates() OVERRIDE;
    8282
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r123065 r123553  
    142142}
    143143
    144 void ImageLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion)
     144void ImageLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats)
    145145{
    146146    createTextureUpdaterIfNeeded();
     
    152152    }
    153153
    154     updateContentRect(updater, visibleContentRect(), occlusion);
     154    updateContentRect(updater, visibleContentRect(), occlusion, stats);
    155155}
    156156
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h

    r121574 r123553  
    5050    virtual bool drawsContent() const OVERRIDE;
    5151    virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE;
    52     virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) OVERRIDE;
     52    virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE;
    5353    virtual bool needsContentsScale() const OVERRIDE;
    5454
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r123375 r123553  
    5757
    5858class CCActiveAnimation;
    59 struct CCAnimationEvent;
    6059class CCLayerAnimationDelegate;
    6160class CCLayerImpl;
     
    6362class CCTextureUpdater;
    6463class ScrollbarLayerChromium;
     64struct CCAnimationEvent;
     65struct CCRenderingStats;
    6566
    6667// Delegate for handling scroll input for a LayerChromium.
     
    212213    // These methods typically need to be overwritten by derived classes.
    213214    virtual bool drawsContent() const { return m_isDrawable; }
    214     virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) { }
     215    virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) { }
    215216    virtual bool needMoreUpdates() { return false; }
    216217    virtual void setIsMask(bool) { }
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h

    r123065 r123553  
    3939class IntSize;
    4040class TextureManager;
     41struct CCRenderingStats;
    4142
    4243class LayerTextureUpdater : public RefCounted<LayerTextureUpdater> {
     
    4950        CCPrioritizedTexture* texture() { return m_texture.get(); }
    5051        void swapTextureWith(OwnPtr<CCPrioritizedTexture>& texture) { m_texture.swap(texture); }
    51         virtual void prepareRect(const IntRect& /* sourceRect */) { }
     52        virtual void prepareRect(const IntRect& /* sourceRect */, CCRenderingStats&) { }
    5253        virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) = 0;
    5354    protected:
     
    7374    // The |resultingOpaqueRect| gives back a region of the layer that was painted opaque. If the layer is marked opaque in the updater,
    7475    // then this region should be ignored in preference for the entire layer's area.
    75     virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect) { }
     76    virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats&) { }
    7677
    7778    // Set true by the layer when it is known that the entire output is going to be opaque.
  • trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp

    r123065 r123553  
    227227}
    228228
    229 void ScrollbarLayerChromium::updatePart(LayerTextureUpdater* painter, LayerTextureUpdater::Texture* texture, const IntRect& rect, CCTextureUpdater& updater)
     229void ScrollbarLayerChromium::updatePart(LayerTextureUpdater* painter, LayerTextureUpdater::Texture* texture, const IntRect& rect, CCTextureUpdater& updater, CCRenderingStats& stats)
    230230{
    231231    // Skip painting and uploading if there are no invalidations and
     
    243243    // Paint and upload the entire part.
    244244    IntRect paintedOpaqueRect;
    245     painter->prepareToUpdate(rect, rect.size(), 1, 1, paintedOpaqueRect);
    246     texture->prepareRect(rect);
     245    painter->prepareToUpdate(rect, rect.size(), 1, 1, paintedOpaqueRect, stats);
     246    texture->prepareRect(rect, stats);
    247247
    248248    IntRect destRect(IntPoint(), rect.size());
     
    274274}
    275275
    276 void ScrollbarLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*)
     276void ScrollbarLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*, CCRenderingStats& stats)
    277277{
    278278    if (contentBounds().isEmpty())
     
    283283    IntPoint scrollbarOrigin(m_scrollbar->x(), m_scrollbar->y());
    284284    IntRect contentRect(scrollbarOrigin, contentBounds());
    285     updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, updater);
     285    updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, updater, stats);
    286286    if (m_foreTrack && m_foreTrackUpdater)
    287         updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, updater);
     287        updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, updater, stats);
    288288
    289289    // Consider the thumb to be at the origin when painting.
    290290    IntRect thumbRect = IntRect(IntPoint(), theme()->thumbRect(m_scrollbar.get()).size());
    291291    if (!thumbRect.isEmpty())
    292         updatePart(m_thumbUpdater.get(), m_thumb.get(), thumbRect, updater);
     292        updatePart(m_thumbUpdater.get(), m_thumb.get(), thumbRect, updater, stats);
    293293}
    294294
  • trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.h

    r121574 r123553  
    4646    // LayerChromium interface
    4747    virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE;
    48     virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) OVERRIDE;
     48    virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE;
    4949    virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE;
    5050    virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE;
     
    6060private:
    6161    ScrollbarThemeComposite* theme() const;
    62     void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, CCTextureUpdater&);
     62    void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, CCTextureUpdater&, CCRenderingStats&);
    6363    void createTextureUpdaterIfNeeded();
    6464
  • trunk/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp

    r121436 r123553  
    4747}
    4848
    49 void SkPictureCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect)
     49void SkPictureCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats)
    5050{
    5151    SkCanvas* canvas = m_picture.beginRecording(contentRect.width(), contentRect.height());
    52     paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect);
     52    paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
    5353    m_picture.endRecording();
    5454}
  • trunk/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h

    r121436 r123553  
    5353    explicit SkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>);
    5454
    55     virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect) OVERRIDE;
     55    virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats&) OVERRIDE;
    5656    void drawPicture(SkCanvas*);
    5757
  • trunk/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp

    r120820 r123553  
    130130}
    131131
    132 void TextureLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*)
     132void TextureLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*, CCRenderingStats&)
    133133{
    134134    if (m_client) {
  • trunk/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h

    r120023 r123553  
    8888    virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE;
    8989    virtual bool drawsContent() const OVERRIDE;
    90     virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) OVERRIDE;
     90    virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE;
    9191    virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE;
    9292
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r123065 r123553  
    346346}
    347347
    348 void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater& updater, const CCOcclusionTracker* occlusion)
     348void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats)
    349349{
    350350    createTextureUpdaterIfNeeded();
     
    438438    RefPtr<LayerTextureUpdater> protector(textureUpdater());
    439439    IntRect paintedOpaqueRect;
    440     textureUpdater()->prepareToUpdate(paintRect, m_tiler->tileSize(), 1 / widthScale, 1 / heightScale, paintedOpaqueRect);
     440    textureUpdater()->prepareToUpdate(paintRect, m_tiler->tileSize(), 1 / widthScale, 1 / heightScale, paintedOpaqueRect, stats);
    441441    m_didPaint = true;
    442442
     
    483483                continue;
    484484
    485             tile->texture()->prepareRect(sourceRect);
     485            tile->texture()->prepareRect(sourceRect, stats);
    486486            if (occlusion)
    487487                occlusion->overdrawMetrics().didUpload(WebTransformationMatrix(), sourceRect, tile->opaqueRect());
     
    611611}
    612612
    613 void TiledLayerChromium::updateContentRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion)
     613void TiledLayerChromium::updateContentRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion, CCRenderingStats& stats)
    614614{
    615615    m_skipsDraw = false;
     
    626626        int left, top, right, bottom;
    627627        m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom);
    628         updateTiles(false, left, top, right, bottom, updater, occlusion);
     628        updateTiles(false, left, top, right, bottom, updater, occlusion, stats);
    629629    }
    630630
     
    643643    // If the layer is not visible, we have nothing to expand from, so instead we prepaint the outer-most set of tiles.
    644644    if (contentRect.isEmpty()) {
    645         updateTiles(true, prepaintLeft, prepaintTop, prepaintRight, prepaintTop, updater, 0);
     645        updateTiles(true, prepaintLeft, prepaintTop, prepaintRight, prepaintTop, updater, 0, stats);
    646646        if (m_didPaint || m_skipsIdlePaint)
    647647            return;
    648         updateTiles(true, prepaintLeft, prepaintBottom, prepaintRight, prepaintBottom, updater, 0);
     648        updateTiles(true, prepaintLeft, prepaintBottom, prepaintRight, prepaintBottom, updater, 0, stats);
    649649        if (m_didPaint || m_skipsIdlePaint)
    650650            return;
    651         updateTiles(true, prepaintLeft, prepaintTop, prepaintLeft, prepaintBottom, updater, 0);
     651        updateTiles(true, prepaintLeft, prepaintTop, prepaintLeft, prepaintBottom, updater, 0, stats);
    652652        if (m_didPaint || m_skipsIdlePaint)
    653653            return;
    654         updateTiles(true, prepaintRight, prepaintTop, prepaintRight, prepaintBottom, updater, 0);
     654        updateTiles(true, prepaintRight, prepaintTop, prepaintRight, prepaintBottom, updater, 0, stats);
    655655        return;
    656656    }
     
    660660
    661661    // Otherwise, prepaint anything that was occluded but inside the layer's visible region.
    662     updateTiles(true, left, top, right, bottom, updater, 0);
     662    updateTiles(true, left, top, right, bottom, updater, 0, stats);
    663663    if (m_didPaint || m_skipsIdlePaint)
    664664        return;
     
    668668        if (bottom < prepaintBottom) {
    669669            ++bottom;
    670             updateTiles(true, left, bottom, right, bottom, updater, 0);
     670            updateTiles(true, left, bottom, right, bottom, updater, 0, stats);
    671671            if (m_didPaint || m_skipsIdlePaint)
    672672                break;
     
    674674        if (top > prepaintTop) {
    675675            --top;
    676             updateTiles(true, left, top, right, top, updater, 0);
     676            updateTiles(true, left, top, right, top, updater, 0, stats);
    677677            if (m_didPaint || m_skipsIdlePaint)
    678678                break;
     
    680680        if (left > prepaintLeft) {
    681681            --left;
    682             updateTiles(true, left, top, left, bottom, updater, 0);
     682            updateTiles(true, left, top, left, bottom, updater, 0, stats);
    683683            if (m_didPaint || m_skipsIdlePaint)
    684684                break;
     
    686686        if (right < prepaintRight) {
    687687            ++right;
    688             updateTiles(true, right, top, right, bottom, updater, 0);
     688            updateTiles(true, right, top, right, bottom, updater, 0, stats);
    689689            if (m_didPaint || m_skipsIdlePaint)
    690690                break;
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h

    r122373 r123553  
    8484
    8585    // Prepare data needed to update textures that intersect with contentRect.
    86     void updateContentRect(CCTextureUpdater&, const IntRect& contentRect, const CCOcclusionTracker*);
     86    void updateContentRect(CCTextureUpdater&, const IntRect& contentRect, const CCOcclusionTracker*, CCRenderingStats&);
    8787
    8888    // After preparing an update, returns true if more painting is needed.
     
    107107    void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visibleContentRect);
    108108
    109     void updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater&, const CCOcclusionTracker*);
     109    void updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&);
    110110
    111111    UpdatableTile* tileAt(int, int) const;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r123375 r123553  
    3939#include "cc/CCOcclusionTracker.h"
    4040#include "cc/CCOverdrawMetrics.h"
    41 #include "cc/CCRenderingStats.h"
    4241#include "cc/CCSettings.h"
    4342#include "cc/CCSingleThreadProxy.h"
     
    7372    , m_needsAnimateLayers(false)
    7473    , m_client(client)
    75     , m_animationFrameNumber(0)
    7674    , m_commitNumber(0)
     75    , m_renderingStats()
    7776    , m_layerRendererInitialized(false)
    7877    , m_contextLost(false)
     
    218217    m_animating = false;
    219218
    220     m_animationFrameNumber++;
     219    m_renderingStats.numAnimationFrames++;
    221220}
    222221
     
    304303void CCLayerTreeHost::renderingStats(CCRenderingStats& stats) const
    305304{
     305    stats = m_renderingStats;
    306306    m_proxy->implSideRenderingStats(stats);
    307     stats.numAnimationFrames = animationFrameNumber();
    308307}
    309308
     
    573572    LayerChromium* maskLayer = renderSurfaceLayer->maskLayer();
    574573    if (maskLayer) {
    575         maskLayer->update(updater, 0);
     574        maskLayer->update(updater, 0, m_renderingStats);
    576575        needMoreUpdates |= maskLayer->needMoreUpdates();
    577576    }
     
    579578    LayerChromium* replicaMaskLayer = renderSurfaceLayer->replicaLayer() ? renderSurfaceLayer->replicaLayer()->maskLayer() : 0;
    580579    if (replicaMaskLayer) {
    581         replicaMaskLayer->update(updater, 0);
     580        replicaMaskLayer->update(updater, 0, m_renderingStats);
    582581        needMoreUpdates |= replicaMaskLayer->needMoreUpdates();
    583582    }
     
    606605        } else if (it.representsItself()) {
    607606            ASSERT(!it->bounds().isEmpty());
    608             it->update(updater, &occlusionTracker);
     607            it->update(updater, &occlusionTracker, m_renderingStats);
    609608            needMoreUpdates |= it->needMoreUpdates();
    610609        }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r123065 r123553  
    3737#include "cc/CCPrioritizedTextureManager.h"
    3838#include "cc/CCProxy.h"
     39#include "cc/CCRenderingStats.h"
    3940
    4041
     
    5455class Region;
    5556class CCPrioritizedTextureManager;
    56 struct CCRenderingStats;
    5757struct CCScrollAndScaleSet;
    5858
     
    203203    void finishAllRendering();
    204204
    205     int animationFrameNumber() const { return m_animationFrameNumber; }
    206 
    207205    int commitNumber() const { return m_commitNumber; }
    208206
     
    279277    void initializeLayerRenderer();
    280278
    281     static void update(LayerChromium*, CCTextureUpdater&, const CCOcclusionTracker*);
     279    void update(LayerChromium*, CCTextureUpdater&, const CCOcclusionTracker*);
    282280    bool paintLayerContents(const LayerList&, CCTextureUpdater&);
    283281    bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdater&);
     
    301299    CCLayerTreeHostClient* m_client;
    302300
    303     int m_animationFrameNumber;
    304301    int m_commitNumber;
     302    CCRenderingStats m_renderingStats;
    305303
    306304    OwnPtr<CCProxy> m_proxy;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderingStats.h

    r123421 r123553  
    3333    int numFramesSentToScreen;
    3434    int droppedFrameCount;
     35    double totalPaintTimeInSeconds;
     36    double totalRasterizeTimeInSeconds;
    3537
    3638    CCRenderingStats()
     
    3840        , numFramesSentToScreen(0)
    3941        , droppedFrameCount(0)
     42        , totalPaintTimeInSeconds(0)
     43        , totalRasterizeTimeInSeconds(0)
    4044    {
    4145    }
  • trunk/Source/WebKit/chromium/ChangeLog

    r123535 r123553  
     12012-07-24  Dave Tu  <dtu@chromium.org>
     2
     3        [chromium] Add time spent painting to GPU benchmarking renderingStats() API.
     4        https://bugs.webkit.org/show_bug.cgi?id=90019
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * src/WebLayerTreeView.cpp:
     9        (WebKit::WebLayerTreeView::renderingStats):
     10        * tests/CCLayerTreeHostTest.cpp:
     11        * tests/CCTiledLayerTestCommon.cpp:
     12        (WebKitTests::FakeLayerTextureUpdater::Texture::prepareRect):
     13        (WebKitTests::FakeTiledLayerChromium::update):
     14        * tests/CCTiledLayerTestCommon.h:
     15        (Texture):
     16        (FakeTiledLayerChromium):
     17        * tests/Canvas2DLayerBridgeTest.cpp:
     18        * tests/ContentLayerChromiumTest.cpp:
     19        (WebKit::TEST):
     20        * tests/TiledLayerChromiumTest.cpp:
     21
    1222012-07-24  Jian Li  <jianli@chromium.org>
    223
  • trunk/Source/WebKit/chromium/src/WebLayerTreeView.cpp

    r123421 r123553  
    184184    stats.numFramesSentToScreen = ccStats.numFramesSentToScreen;
    185185    stats.droppedFrameCount = ccStats.droppedFrameCount;
     186    stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds;
     187    stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds;
    186188}
    187189
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp

    r123375 r123553  
    11611161    void resetPaintContentsCount() { m_paintContentsCount = 0; }
    11621162
    1163     virtual void update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion) OVERRIDE
    1164     {
    1165         ContentLayerChromium::update(updater, occlusion);
     1163    virtual void update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) OVERRIDE
     1164    {
     1165        ContentLayerChromium::update(updater, occlusion, stats);
    11661166        m_paintContentsCount++;
    11671167    }
     
    15771577    static PassRefPtr<TestLayerChromium> create() { return adoptRef(new TestLayerChromium()); }
    15781578
    1579     virtual void update(CCTextureUpdater&, const CCOcclusionTracker* occlusion) OVERRIDE
     1579    virtual void update(CCTextureUpdater&, const CCOcclusionTracker* occlusion, CCRenderingStats&) OVERRIDE
    15801580    {
    15811581        // Gain access to internals of the CCOcclusionTracker.
  • trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp

    r123065 r123553  
    4747}
    4848
    49 void FakeLayerTextureUpdater::Texture::prepareRect(const IntRect&)
     49void FakeLayerTextureUpdater::Texture::prepareRect(const IntRect&, WebCore::CCRenderingStats&)
    5050{
    5151    m_layer->prepareRect();
     
    6363}
    6464
    65 void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect)
     65void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, CCRenderingStats&)
    6666{
    6767    m_prepareCount++;
     
    116116}
    117117
    118 void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion)
     118void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats)
    119119{
    120     updateContentRect(updater, visibleContentRect(), occlusion);
     120    updateContentRect(updater, visibleContentRect(), occlusion, stats);
    121121}
    122122
  • trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h

    r123065 r123553  
    5151
    5252        virtual void updateRect(WebCore::CCResourceProvider* , const WebCore::IntRect&, const WebCore::IntRect&) OVERRIDE;
    53         virtual void prepareRect(const WebCore::IntRect&) OVERRIDE;
     53        virtual void prepareRect(const WebCore::IntRect&, WebCore::CCRenderingStats&) OVERRIDE;
    5454
    5555    private:
     
    6363    virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE { return SampledTexelFormatRGBA; }
    6464
    65     virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebCore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect) OVERRIDE;
     65    virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebCore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect, WebCore::CCRenderingStats&) OVERRIDE;
    6666    // Sets the rect to invalidate during the next call to prepareToUpdate(). After the next
    6767    // call to prepareToUpdate() the rect is reset.
     
    123123
    124124    // Updates the visibleContentRect().
    125     virtual void update(WebCore::CCTextureUpdater&, const WebCore::CCOcclusionTracker*) OVERRIDE;
     125    virtual void update(WebCore::CCTextureUpdater&, const WebCore::CCOcclusionTracker*, WebCore::CCRenderingStats&) OVERRIDE;
    126126
    127127    virtual void setTexturePriorities(const WebCore::CCPriorityCalculator&) OVERRIDE;
  • trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp

    r122506 r123553  
    3434#include "WebKit.h"
    3535#include "cc/CCGraphicsContext.h"
     36#include "cc/CCRenderingStats.h"
    3637#include "cc/CCTextureUpdater.h"
    3738#include "platform/WebKitPlatformSupport.h"
     
    152153    bridge.clear();
    153154    CCTextureUpdater updater;
    154     layer->update(updater, 0);
     155    CCRenderingStats stats;
     156    layer->update(updater, 0, stats);
    155157}
    156158
    157159} // namespace
    158 
  • trunk/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp

    r123065 r123553  
    3131#include "GraphicsContext.h"
    3232#include "OpaqueRectTrackingContentLayerDelegate.h"
     33#include "cc/CCRenderingStats.h"
    3334#include "skia/ext/platform_canvas.h"
    3435
     
    103104
    104105    IntRect resultingOpaqueRect;
    105     updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, contentsScale, resultingOpaqueRect);
     106    CCRenderingStats stats;
     107    updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, contentsScale, resultingOpaqueRect, stats);
    106108
    107109    EXPECT_INT_RECT_EQ(opaqueRectInContentSpace, resultingOpaqueRect);
  • trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

    r123065 r123553  
    3636#include "WebCompositor.h"
    3737#include "cc/CCOverdrawMetrics.h"
     38#include "cc/CCRenderingStats.h"
    3839#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
    3940#include <gtest/gtest.h>
     
    9596    OwnPtr<CCResourceProvider> m_resourceProvider;
    9697    CCTextureUpdater m_updater;
     98    CCRenderingStats m_stats;
    9799    FakeTextureCopier m_copier;
    98100    FakeTextureUploader m_uploader;
     
    117119    textureManager->prioritizeTextures();
    118120
    119     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     121    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    120122    updateTextures();
    121123    layer->pushPropertiesTo(layerImpl.get());
     
    130132    layer->setTexturePriorities(m_priorityCalculator);
    131133    textureManager->prioritizeTextures();
    132     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
     134    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
    133135    layer->pushPropertiesTo(layerImpl.get());
    134136
     
    155157    textureManager->prioritizeTextures();
    156158
    157     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded);
     159    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded, m_stats);
    158160    updateTextures();
    159161    layer->pushPropertiesTo(layerImpl.get());
     
    171173    // ....but the area is occluded.
    172174    occluded.setOcclusion(IntRect(0, 0, 50, 50));
    173     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded);
     175    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded, m_stats);
    174176    updateTextures();
    175177    layer->pushPropertiesTo(layerImpl.get());
     
    199201    textureManager->prioritizeTextures();
    200202
    201     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     203    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    202204    updateTextures();
    203205    layer->pushPropertiesTo(layerImpl.get());
     
    221223    layer->setTexturePriorities(m_priorityCalculator);
    222224    textureManager->prioritizeTextures();
    223     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
     225    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
    224226    updateTextures();
    225227    layer->pushPropertiesTo(layerImpl.get());
     
    250252    textureManager->prioritizeTextures();
    251253
    252     layer->updateContentRect(m_updater, visibleRect, 0);
     254    layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    253255    updateTextures();
    254256
     
    266268        textureManager->prioritizeTextures();
    267269
    268         layer->updateContentRect(m_updater, visibleRect, 0);
     270        layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    269271        EXPECT_TRUE(layer->needsIdlePaint(visibleRect));
    270272        updateTextures();
     
    317319    layer1->setTexturePriorities(m_priorityCalculator);
    318320    textureManager->prioritizeTextures();
    319     layer1->updateContentRect(m_updater, layerRect, 0);
    320     layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
     321    layer1->updateContentRect(m_updater, layerRect, 0, m_stats);
     322    layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
    321323
    322324    // We should need idle-painting for both remaining tiles in layer2.
     
    335337    layer1->setTexturePriorities(m_priorityCalculator);
    336338    textureManager->prioritizeTextures();
    337     layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
     339    layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
    338340
    339341    // Oh well, commit the frame and push.
     
    355357    layer1->setTexturePriorities(m_priorityCalculator);
    356358    textureManager->prioritizeTextures();
    357     layer2->updateContentRect(m_updater, layer2Rect, 0);
    358     layer1->updateContentRect(m_updater, layerRect, 0);
     359    layer2->updateContentRect(m_updater, layer2Rect, 0, m_stats);
     360    layer1->updateContentRect(m_updater, layerRect, 0, m_stats);
    359361
    360362    updateTextures();
     
    388390    layer->setTexturePriorities(m_priorityCalculator);
    389391    textureManager->prioritizeTextures();
    390     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded);
     392    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded, m_stats);
    391393    updateTextures();
    392394    layer->pushPropertiesTo(layerImpl.get());
     
    413415    layer->setTexturePriorities(m_priorityCalculator);
    414416    textureManager->prioritizeTextures();
    415     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     417    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    416418    updateTextures();
    417419    layer->pushPropertiesTo(layerImpl.get());
     
    443445    textureManager->prioritizeTextures();
    444446
    445     layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     447    layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    446448
    447449    // Invalidate a tile on layer1
    448450    layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
    449     layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     451    layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    450452
    451453    updateTextures();
     
    483485    // Invalidate a tile on layer2
    484486    layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
    485     layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
    486     layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     487    layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
     488    layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    487489    updateTextures();
    488490    layer1->pushPropertiesTo(layer1Impl.get());
     
    518520    layer->setTexturePriorities(m_priorityCalculator);
    519521    textureManager->prioritizeTextures();
    520     layer->updateContentRect(m_updater, visibleRect, 0);
     522    layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    521523
    522524    // Idle-painting should see no more priority tiles for painting.
     
    531533    layer->setTexturePriorities(m_priorityCalculator);
    532534    textureManager->prioritizeTextures();
    533     layer->updateContentRect(m_updater, visibleRect, 0);
     535    layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    534536
    535537    // We shouldn't signal we need another idle paint.
     
    560562
    561563        // Empty layers don't paint or idle-paint.
    562         layer->updateContentRect(m_updater, contentRect, 0);
     564        layer->updateContentRect(m_updater, contentRect, 0, m_stats);
    563565
    564566        // Empty layers don't have tiles.
     
    596598        layer->setTexturePriorities(m_priorityCalculator);
    597599        textureManager->prioritizeTextures();
    598         layer->updateContentRect(m_updater, visibleRect, 0);
     600        layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    599601
    600602        // Non-visible layers don't need idle paint.
     
    659661                textureManager->prioritizeTextures();
    660662
    661                 layer->updateContentRect(m_updater, visibleRect, 0);
     663                layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    662664                updateTextures();
    663665                layer->pushPropertiesTo(layerImpl.get());
     
    672674                textureManager->prioritizeTextures();
    673675
    674                 layer->updateContentRect(m_updater, visibleRect, 0);
     676                layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
    675677                updateTextures();
    676678                layer->pushPropertiesTo(layerImpl.get());
     
    695697    layer->setTexturePriorities(m_priorityCalculator);
    696698    textureManager->prioritizeTextures();
    697     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     699    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    698700    updateTextures(1000);
    699701    layer->pushPropertiesTo(layerImpl.get());
     
    706708    // Invoke updateContentRect again. As the layer is valid updateContentRect shouldn't be invoked on
    707709    // the LayerTextureUpdater.
    708     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     710    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    709711    updateTextures(1000);
    710712    EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount());
     
    714716    layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
    715717    layer->fakeLayerTextureUpdater()->clearPrepareCount();
    716     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     718    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    717719    updateTextures(1000);
    718720    EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
    719721    layer->fakeLayerTextureUpdater()->clearPrepareCount();
    720722    // The layer should still be invalid as updateContentRect invoked invalidate.
    721     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     723    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    722724    updateTextures(1000);
    723725    EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
     
    746748    layer->setTexturePriorities(m_priorityCalculator);
    747749    textureManager->prioritizeTextures();
    748     layer->updateContentRect(m_updater, contentBounds, 0);
     750    layer->updateContentRect(m_updater, contentBounds, 0, m_stats);
    749751    EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect());
    750752    updateTextures();
     
    754756    textureManager->prioritizeTextures();
    755757    layer->invalidateContentRect(contentBounds);
    756     layer->updateContentRect(m_updater, contentBounds, 0);
     758    layer->updateContentRect(m_updater, contentBounds, 0, m_stats);
    757759    EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect());
    758760    updateTextures();
     
    763765    layer->setTexturePriorities(m_priorityCalculator);
    764766    textureManager->prioritizeTextures();
    765     layer->updateContentRect(m_updater, contentBounds, 0);
     767    layer->updateContentRect(m_updater, contentBounds, 0, m_stats);
    766768    EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect());
    767769}
     
    785787    layer->setTexturePriorities(m_priorityCalculator);
    786788    textureManager->prioritizeTextures();
    787     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
     789    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
    788790    updateTextures();
    789791    layer->pushPropertiesTo(layerImpl.get());
     
    802804    layer->setTexturePriorities(m_priorityCalculator);
    803805    textureManager->prioritizeTextures();
    804     layer->updateContentRect(m_updater, IntRect(0, 0, 200, 200), 0);
     806    layer->updateContentRect(m_updater, IntRect(0, 0, 200, 200), 0, m_stats);
    805807    updateTextures();
    806808    layer->pushPropertiesTo(layerImpl.get());
     
    814816    layer->setNeedsDisplay();
    815817    layer->setTexturePriorities(m_priorityCalculator);
    816     layer->updateContentRect(m_updater, IntRect(1, 0, 0, 1), 0);
     818    layer->updateContentRect(m_updater, IntRect(1, 0, 0, 1), 0, m_stats);
    817819    textureManager->prioritizeTextures();
    818820
     
    886888    layer->setTexturePriorities(m_priorityCalculator);
    887889    textureManager->prioritizeTextures();
    888     layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0);
     890    layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0, m_stats);
    889891
    890892    layer->setBounds(IntSize(200, 200));
     
    905907    layer->setTexturePriorities(m_priorityCalculator);
    906908    textureManager->prioritizeTextures();
    907     layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0);
     909    layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0, m_stats);
    908910}
    909911
     
    10481050    layer->setTexturePriorities(m_priorityCalculator);
    10491051    textureManager->prioritizeTextures();
    1050     layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
     1052    layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
    10511053    EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10521054}
     
    10691071    layer->setTexturePriorities(m_priorityCalculator);
    10701072    textureManager->prioritizeTextures();
    1071     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1073    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    10721074    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10731075
     
    10801082    occluded.setOcclusion(IntRect(250, 200, 300, 100));
    10811083    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
    1082     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1084    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    10831085    EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10841086
     
    10911093    occluded.setOcclusion(IntRect(250, 250, 300, 100));
    10921094    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
    1093     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1095    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    10941096    EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10951097
     
    11171119    layer->setTexturePriorities(m_priorityCalculator);
    11181120    textureManager->prioritizeTextures();
    1119     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 360), &occluded);
     1121    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 360), &occluded, m_stats);
    11201122    EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11211123
     
    11321134    layer->setTexturePriorities(m_priorityCalculator);
    11331135    textureManager->prioritizeTextures();
    1134     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 350), &occluded);
     1136    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 350), &occluded, m_stats);
    11351137    EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11361138
     
    11471149    layer->setTexturePriorities(m_priorityCalculator);
    11481150    textureManager->prioritizeTextures();
    1149     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 340), &occluded);
     1151    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 340), &occluded, m_stats);
    11501152    EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11511153
     
    11721174    layer->setTexturePriorities(m_priorityCalculator);
    11731175    textureManager->prioritizeTextures();
    1174     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1176    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    11751177    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11761178    {
     
    11861188
    11871189    // Repaint without marking it dirty. The 3 culled tiles will be pre-painted now.
    1188     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1190    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    11891191    EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11901192
     
    12151217    layer->setTexturePriorities(m_priorityCalculator);
    12161218    textureManager->prioritizeTextures();
    1217     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1219    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    12181220    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    12191221
     
    12431245    layer->setTexturePriorities(m_priorityCalculator);
    12441246    textureManager->prioritizeTextures();
    1245     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1247    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    12461248    // The content is half the size of the layer (so the number of tiles is fewer).
    12471249    // In this case, the content is 300x300, and since the tile size is 100, the
     
    12631265    layer->setTexturePriorities(m_priorityCalculator);
    12641266    textureManager->prioritizeTextures();
    1265     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1267    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    12661268    EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
    12671269
     
    12831285    layer->setTexturePriorities(m_priorityCalculator);
    12841286    textureManager->prioritizeTextures();
    1285     layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
     1287    layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
    12861288    EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
    12871289
     
    13171319    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    13181320    layer->invalidateContentRect(contentBounds);
    1319     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1321    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    13201322    opaqueContents = layer->visibleContentOpaqueRegion();
    13211323    EXPECT_TRUE(opaqueContents.isEmpty());
     
    13301332    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
    13311333    layer->invalidateContentRect(contentBounds);
    1332     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1334    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    13331335    updateTextures();
    13341336    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13431345    // If we paint again without invalidating, the same stuff should be opaque.
    13441346    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1345     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1347    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    13461348    updateTextures();
    13471349    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13581360    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    13591361    layer->invalidateContentRect(IntRect(0, 0, 1, 1));
    1360     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1362    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    13611363    updateTextures();
    13621364    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13731375    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    13741376    layer->invalidateContentRect(IntRect(10, 10, 1, 1));
    1375     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1377    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    13761378    updateTextures();
    13771379    opaqueContents = layer->visibleContentOpaqueRegion();
     
    14111413    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    14121414    layer->invalidateContentRect(contentBounds);
    1413     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1415    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    14141416    updateTextures();
    14151417    opaqueContents = layer->visibleContentOpaqueRegion();
     
    14261428    layer->invalidateContentRect(IntRect(0, 0, 1, 1));
    14271429    layer->invalidateContentRect(IntRect(50, 200, 10, 10));
    1428     layer->updateContentRect(m_updater, contentBounds, &occluded);
     1430    layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
    14291431    updateTextures();
    14301432    opaqueContents = layer->visibleContentOpaqueRegion();
     
    16541656
    16551657    // Update the whole tile.
    1656     layer->updateContentRect(m_updater, contentRect, 0);
     1658    layer->updateContentRect(m_updater, contentRect, 0, m_stats);
    16571659    layer->trackingLayerPainter()->resetPaintedRect();
    16581660
     
    16661668    // Invalidate the entire layer in content space. When painting, the rect given to webkit should match the layer's bounds.
    16671669    layer->invalidateContentRect(contentRect);
    1668     layer->updateContentRect(m_updater, contentRect, 0);
     1670    layer->updateContentRect(m_updater, contentRect, 0, m_stats);
    16691671
    16701672    EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
     
    16891691
    16901692    // Update the whole tile.
    1691     layer->updateContentRect(m_updater, contentRect, 0);
     1693    layer->updateContentRect(m_updater, contentRect, 0, m_stats);
    16921694    layer->trackingLayerPainter()->resetPaintedRect();
    16931695
     
    17011703    // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds.
    17021704    layer->setNeedsDisplayRect(layerRect);
    1703     layer->updateContentRect(m_updater, contentRect, 0);
     1705    layer->updateContentRect(m_updater, contentRect, 0, m_stats);
    17041706
    17051707    EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
Note: See TracChangeset for help on using the changeset viewer.