Changeset 123553 in webkit
- Timestamp:
- Jul 24, 2012 5:25:53 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/ChangeLog
r123533 r123553 1 2012-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 1 12 2012-07-24 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/Source/Platform/chromium/public/WebRenderingStats.h
r123421 r123553 33 33 int numFramesSentToScreen; 34 34 int droppedFrameCount; 35 double totalPaintTimeInSeconds; 36 double totalRasterizeTimeInSeconds; 35 37 36 38 WebRenderingStats() … … 38 40 , numFramesSentToScreen(0) 39 41 , droppedFrameCount(0) 42 , totalPaintTimeInSeconds(0) 43 , totalRasterizeTimeInSeconds(0) 40 44 { 41 45 } -
trunk/Source/WebCore/ChangeLog
r123550 r123553 1 2012-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 1 65 2012-07-24 Jian Li <jianli@chromium.org> 2 66 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp
r123065 r123553 80 80 } 81 81 82 void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect )82 void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats) 83 83 { 84 84 if (m_canvasSize != contentRect.size()) { … … 87 87 } 88 88 89 paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect );89 paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats); 90 90 } 91 91 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
r123065 r123553 61 61 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*); 62 62 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; 64 64 void updateTextureRect(CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntRect& destRect); 65 65 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
r123065 r123553 35 35 #include "SkCanvas.h" 36 36 #include "SkDevice.h" 37 #include "cc/CCRenderingStats.h" 38 #include <wtf/CurrentTime.h> 37 39 38 40 namespace WebCore { … … 44 46 } 45 47 46 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRect& sourceRect )48 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRect& sourceRect, CCRenderingStats& stats) 47 49 { 48 50 m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRect.height()); … … 51 53 SkDevice device(m_bitmap); 52 54 SkCanvas canvas(&device); 53 textureUpdater()->paintContentsRect(&canvas, sourceRect); 55 double paintBeginTime = monotonicallyIncreasingTime(); 56 textureUpdater()->paintContentsRect(&canvas, sourceRect, stats); 57 stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginTime; 54 58 } 55 59 … … 88 92 } 89 93 90 void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect )94 void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, CCRenderingStats& stats) 91 95 { 92 96 // Translate the origin of contentRect to that of sourceRect. 93 97 canvas->translate(contentRect().x() - sourceRect.x(), 94 98 contentRect().y() - sourceRect.y()); 99 double rasterizeBeginTime = monotonicallyIncreasingTime(); 95 100 drawPicture(canvas); 101 stats.totalRasterizeTimeInSeconds += monotonicallyIncreasingTime() - rasterizeBeginTime; 96 102 } 97 103 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
r123065 r123553 42 42 Texture(BitmapSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<CCPrioritizedTexture>); 43 43 44 virtual void prepareRect(const IntRect& sourceRect ) OVERRIDE;44 virtual void prepareRect(const IntRect& sourceRect, CCRenderingStats&) OVERRIDE; 45 45 virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) OVERRIDE; 46 46 … … 57 57 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*) OVERRIDE; 58 58 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRIDE; 59 void paintContentsRect(SkCanvas*, const IntRect& sourceRect );59 void paintContentsRect(SkCanvas*, const IntRect& sourceRect, CCRenderingStats&); 60 60 61 61 private: -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp
r122373 r123553 38 38 #include "SkiaUtils.h" 39 39 #include "TraceEvent.h" 40 #include "cc/CCRenderingStats.h" 41 #include <wtf/CurrentTime.h> 40 42 41 43 namespace WebCore { … … 50 52 } 51 53 52 void CanvasLayerTextureUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect )54 void CanvasLayerTextureUpdater::paintContents(SkCanvas* canvas, const IntRect& contentRect, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats) 53 55 { 54 56 TRACE_EVENT0("cc", "CanvasLayerTextureUpdater::paintContents"); … … 73 75 74 76 FloatRect opaqueLayerRect; 77 double paintBeginTime = monotonicallyIncreasingTime(); 75 78 m_painter->paint(canvas, layerRect, opaqueLayerRect); 79 stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginTime; 76 80 canvas->restore(); 77 81 -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h
r121436 r123553 48 48 explicit CanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>); 49 49 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&); 51 51 const IntRect& contentRect() const { return m_contentRect; } 52 52 -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r123065 r123553 94 94 } 95 95 96 void ContentLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion )96 void ContentLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) 97 97 { 98 98 createTextureUpdaterIfNeeded(); … … 105 105 contentRect = visibleContentRect(); 106 106 107 updateContentRect(updater, contentRect, occlusion );107 updateContentRect(updater, contentRect, occlusion, stats); 108 108 m_needsDisplay = false; 109 109 } -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h
r122185 r123553 78 78 virtual bool drawsContent() const OVERRIDE; 79 79 virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; 80 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* ) OVERRIDE;80 virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; 81 81 virtual bool needMoreUpdates() OVERRIDE; 82 82 -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
r123065 r123553 142 142 } 143 143 144 void ImageLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion )144 void ImageLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) 145 145 { 146 146 createTextureUpdaterIfNeeded(); … … 152 152 } 153 153 154 updateContentRect(updater, visibleContentRect(), occlusion );154 updateContentRect(updater, visibleContentRect(), occlusion, stats); 155 155 } 156 156 -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h
r121574 r123553 50 50 virtual bool drawsContent() const OVERRIDE; 51 51 virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; 52 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* ) OVERRIDE;52 virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; 53 53 virtual bool needsContentsScale() const OVERRIDE; 54 54 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r123375 r123553 57 57 58 58 class CCActiveAnimation; 59 struct CCAnimationEvent;60 59 class CCLayerAnimationDelegate; 61 60 class CCLayerImpl; … … 63 62 class CCTextureUpdater; 64 63 class ScrollbarLayerChromium; 64 struct CCAnimationEvent; 65 struct CCRenderingStats; 65 66 66 67 // Delegate for handling scroll input for a LayerChromium. … … 212 213 // These methods typically need to be overwritten by derived classes. 213 214 virtual bool drawsContent() const { return m_isDrawable; } 214 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* ) { }215 virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) { } 215 216 virtual bool needMoreUpdates() { return false; } 216 217 virtual void setIsMask(bool) { } -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
r123065 r123553 39 39 class IntSize; 40 40 class TextureManager; 41 struct CCRenderingStats; 41 42 42 43 class LayerTextureUpdater : public RefCounted<LayerTextureUpdater> { … … 49 50 CCPrioritizedTexture* texture() { return m_texture.get(); } 50 51 void swapTextureWith(OwnPtr<CCPrioritizedTexture>& texture) { m_texture.swap(texture); } 51 virtual void prepareRect(const IntRect& /* sourceRect */ ) { }52 virtual void prepareRect(const IntRect& /* sourceRect */, CCRenderingStats&) { } 52 53 virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntRect& destRect) = 0; 53 54 protected: … … 73 74 // The |resultingOpaqueRect| gives back a region of the layer that was painted opaque. If the layer is marked opaque in the updater, 74 75 // 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&) { } 76 77 77 78 // 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 227 227 } 228 228 229 void ScrollbarLayerChromium::updatePart(LayerTextureUpdater* painter, LayerTextureUpdater::Texture* texture, const IntRect& rect, CCTextureUpdater& updater )229 void ScrollbarLayerChromium::updatePart(LayerTextureUpdater* painter, LayerTextureUpdater::Texture* texture, const IntRect& rect, CCTextureUpdater& updater, CCRenderingStats& stats) 230 230 { 231 231 // Skip painting and uploading if there are no invalidations and … … 243 243 // Paint and upload the entire part. 244 244 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); 247 247 248 248 IntRect destRect(IntPoint(), rect.size()); … … 274 274 } 275 275 276 void ScrollbarLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* )276 void ScrollbarLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*, CCRenderingStats& stats) 277 277 { 278 278 if (contentBounds().isEmpty()) … … 283 283 IntPoint scrollbarOrigin(m_scrollbar->x(), m_scrollbar->y()); 284 284 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); 286 286 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); 288 288 289 289 // Consider the thumb to be at the origin when painting. 290 290 IntRect thumbRect = IntRect(IntPoint(), theme()->thumbRect(m_scrollbar.get()).size()); 291 291 if (!thumbRect.isEmpty()) 292 updatePart(m_thumbUpdater.get(), m_thumb.get(), thumbRect, updater );292 updatePart(m_thumbUpdater.get(), m_thumb.get(), thumbRect, updater, stats); 293 293 } 294 294 -
trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.h
r121574 r123553 46 46 // LayerChromium interface 47 47 virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; 48 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* ) OVERRIDE;48 virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; 49 49 virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; 50 50 virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE; … … 60 60 private: 61 61 ScrollbarThemeComposite* theme() const; 62 void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, CCTextureUpdater& );62 void updatePart(LayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, CCTextureUpdater&, CCRenderingStats&); 63 63 void createTextureUpdaterIfNeeded(); 64 64 -
trunk/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp
r121436 r123553 47 47 } 48 48 49 void SkPictureCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect )49 void SkPictureCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats& stats) 50 50 { 51 51 SkCanvas* canvas = m_picture.beginRecording(contentRect.width(), contentRect.height()); 52 paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect );52 paintContents(canvas, contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats); 53 53 m_picture.endRecording(); 54 54 } -
trunk/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h
r121436 r123553 53 53 explicit SkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>); 54 54 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; 56 56 void drawPicture(SkCanvas*); 57 57 -
trunk/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
r120820 r123553 130 130 } 131 131 132 void TextureLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* )132 void TextureLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*, CCRenderingStats&) 133 133 { 134 134 if (m_client) { -
trunk/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h
r120023 r123553 88 88 virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; 89 89 virtual bool drawsContent() const OVERRIDE; 90 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* ) OVERRIDE;90 virtual void update(CCTextureUpdater&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; 91 91 virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE; 92 92 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r123065 r123553 346 346 } 347 347 348 void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater& updater, const CCOcclusionTracker* occlusion )348 void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) 349 349 { 350 350 createTextureUpdaterIfNeeded(); … … 438 438 RefPtr<LayerTextureUpdater> protector(textureUpdater()); 439 439 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); 441 441 m_didPaint = true; 442 442 … … 483 483 continue; 484 484 485 tile->texture()->prepareRect(sourceRect );485 tile->texture()->prepareRect(sourceRect, stats); 486 486 if (occlusion) 487 487 occlusion->overdrawMetrics().didUpload(WebTransformationMatrix(), sourceRect, tile->opaqueRect()); … … 611 611 } 612 612 613 void TiledLayerChromium::updateContentRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion )613 void TiledLayerChromium::updateContentRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) 614 614 { 615 615 m_skipsDraw = false; … … 626 626 int left, top, right, bottom; 627 627 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); 629 629 } 630 630 … … 643 643 // If the layer is not visible, we have nothing to expand from, so instead we prepaint the outer-most set of tiles. 644 644 if (contentRect.isEmpty()) { 645 updateTiles(true, prepaintLeft, prepaintTop, prepaintRight, prepaintTop, updater, 0 );645 updateTiles(true, prepaintLeft, prepaintTop, prepaintRight, prepaintTop, updater, 0, stats); 646 646 if (m_didPaint || m_skipsIdlePaint) 647 647 return; 648 updateTiles(true, prepaintLeft, prepaintBottom, prepaintRight, prepaintBottom, updater, 0 );648 updateTiles(true, prepaintLeft, prepaintBottom, prepaintRight, prepaintBottom, updater, 0, stats); 649 649 if (m_didPaint || m_skipsIdlePaint) 650 650 return; 651 updateTiles(true, prepaintLeft, prepaintTop, prepaintLeft, prepaintBottom, updater, 0 );651 updateTiles(true, prepaintLeft, prepaintTop, prepaintLeft, prepaintBottom, updater, 0, stats); 652 652 if (m_didPaint || m_skipsIdlePaint) 653 653 return; 654 updateTiles(true, prepaintRight, prepaintTop, prepaintRight, prepaintBottom, updater, 0 );654 updateTiles(true, prepaintRight, prepaintTop, prepaintRight, prepaintBottom, updater, 0, stats); 655 655 return; 656 656 } … … 660 660 661 661 // 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); 663 663 if (m_didPaint || m_skipsIdlePaint) 664 664 return; … … 668 668 if (bottom < prepaintBottom) { 669 669 ++bottom; 670 updateTiles(true, left, bottom, right, bottom, updater, 0 );670 updateTiles(true, left, bottom, right, bottom, updater, 0, stats); 671 671 if (m_didPaint || m_skipsIdlePaint) 672 672 break; … … 674 674 if (top > prepaintTop) { 675 675 --top; 676 updateTiles(true, left, top, right, top, updater, 0 );676 updateTiles(true, left, top, right, top, updater, 0, stats); 677 677 if (m_didPaint || m_skipsIdlePaint) 678 678 break; … … 680 680 if (left > prepaintLeft) { 681 681 --left; 682 updateTiles(true, left, top, left, bottom, updater, 0 );682 updateTiles(true, left, top, left, bottom, updater, 0, stats); 683 683 if (m_didPaint || m_skipsIdlePaint) 684 684 break; … … 686 686 if (right < prepaintRight) { 687 687 ++right; 688 updateTiles(true, right, top, right, bottom, updater, 0 );688 updateTiles(true, right, top, right, bottom, updater, 0, stats); 689 689 if (m_didPaint || m_skipsIdlePaint) 690 690 break; -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
r122373 r123553 84 84 85 85 // 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&); 87 87 88 88 // After preparing an update, returns true if more painting is needed. … … 107 107 void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visibleContentRect); 108 108 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&); 110 110 111 111 UpdatableTile* tileAt(int, int) const; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r123375 r123553 39 39 #include "cc/CCOcclusionTracker.h" 40 40 #include "cc/CCOverdrawMetrics.h" 41 #include "cc/CCRenderingStats.h"42 41 #include "cc/CCSettings.h" 43 42 #include "cc/CCSingleThreadProxy.h" … … 73 72 , m_needsAnimateLayers(false) 74 73 , m_client(client) 75 , m_animationFrameNumber(0)76 74 , m_commitNumber(0) 75 , m_renderingStats() 77 76 , m_layerRendererInitialized(false) 78 77 , m_contextLost(false) … … 218 217 m_animating = false; 219 218 220 m_ animationFrameNumber++;219 m_renderingStats.numAnimationFrames++; 221 220 } 222 221 … … 304 303 void CCLayerTreeHost::renderingStats(CCRenderingStats& stats) const 305 304 { 305 stats = m_renderingStats; 306 306 m_proxy->implSideRenderingStats(stats); 307 stats.numAnimationFrames = animationFrameNumber();308 307 } 309 308 … … 573 572 LayerChromium* maskLayer = renderSurfaceLayer->maskLayer(); 574 573 if (maskLayer) { 575 maskLayer->update(updater, 0 );574 maskLayer->update(updater, 0, m_renderingStats); 576 575 needMoreUpdates |= maskLayer->needMoreUpdates(); 577 576 } … … 579 578 LayerChromium* replicaMaskLayer = renderSurfaceLayer->replicaLayer() ? renderSurfaceLayer->replicaLayer()->maskLayer() : 0; 580 579 if (replicaMaskLayer) { 581 replicaMaskLayer->update(updater, 0 );580 replicaMaskLayer->update(updater, 0, m_renderingStats); 582 581 needMoreUpdates |= replicaMaskLayer->needMoreUpdates(); 583 582 } … … 606 605 } else if (it.representsItself()) { 607 606 ASSERT(!it->bounds().isEmpty()); 608 it->update(updater, &occlusionTracker );607 it->update(updater, &occlusionTracker, m_renderingStats); 609 608 needMoreUpdates |= it->needMoreUpdates(); 610 609 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r123065 r123553 37 37 #include "cc/CCPrioritizedTextureManager.h" 38 38 #include "cc/CCProxy.h" 39 #include "cc/CCRenderingStats.h" 39 40 40 41 … … 54 55 class Region; 55 56 class CCPrioritizedTextureManager; 56 struct CCRenderingStats;57 57 struct CCScrollAndScaleSet; 58 58 … … 203 203 void finishAllRendering(); 204 204 205 int animationFrameNumber() const { return m_animationFrameNumber; }206 207 205 int commitNumber() const { return m_commitNumber; } 208 206 … … 279 277 void initializeLayerRenderer(); 280 278 281 staticvoid update(LayerChromium*, CCTextureUpdater&, const CCOcclusionTracker*);279 void update(LayerChromium*, CCTextureUpdater&, const CCOcclusionTracker*); 282 280 bool paintLayerContents(const LayerList&, CCTextureUpdater&); 283 281 bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdater&); … … 301 299 CCLayerTreeHostClient* m_client; 302 300 303 int m_animationFrameNumber;304 301 int m_commitNumber; 302 CCRenderingStats m_renderingStats; 305 303 306 304 OwnPtr<CCProxy> m_proxy; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderingStats.h
r123421 r123553 33 33 int numFramesSentToScreen; 34 34 int droppedFrameCount; 35 double totalPaintTimeInSeconds; 36 double totalRasterizeTimeInSeconds; 35 37 36 38 CCRenderingStats() … … 38 40 , numFramesSentToScreen(0) 39 41 , droppedFrameCount(0) 42 , totalPaintTimeInSeconds(0) 43 , totalRasterizeTimeInSeconds(0) 40 44 { 41 45 } -
trunk/Source/WebKit/chromium/ChangeLog
r123535 r123553 1 2012-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 1 22 2012-07-24 Jian Li <jianli@chromium.org> 2 23 -
trunk/Source/WebKit/chromium/src/WebLayerTreeView.cpp
r123421 r123553 184 184 stats.numFramesSentToScreen = ccStats.numFramesSentToScreen; 185 185 stats.droppedFrameCount = ccStats.droppedFrameCount; 186 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; 187 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; 186 188 } 187 189 -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r123375 r123553 1161 1161 void resetPaintContentsCount() { m_paintContentsCount = 0; } 1162 1162 1163 virtual void update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion ) OVERRIDE1164 { 1165 ContentLayerChromium::update(updater, occlusion );1163 virtual void update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) OVERRIDE 1164 { 1165 ContentLayerChromium::update(updater, occlusion, stats); 1166 1166 m_paintContentsCount++; 1167 1167 } … … 1577 1577 static PassRefPtr<TestLayerChromium> create() { return adoptRef(new TestLayerChromium()); } 1578 1578 1579 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* occlusion ) OVERRIDE1579 virtual void update(CCTextureUpdater&, const CCOcclusionTracker* occlusion, CCRenderingStats&) OVERRIDE 1580 1580 { 1581 1581 // Gain access to internals of the CCOcclusionTracker. -
trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
r123065 r123553 47 47 } 48 48 49 void FakeLayerTextureUpdater::Texture::prepareRect(const IntRect& )49 void FakeLayerTextureUpdater::Texture::prepareRect(const IntRect&, WebCore::CCRenderingStats&) 50 50 { 51 51 m_layer->prepareRect(); … … 63 63 } 64 64 65 void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect )65 void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, CCRenderingStats&) 66 66 { 67 67 m_prepareCount++; … … 116 116 } 117 117 118 void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion )118 void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) 119 119 { 120 updateContentRect(updater, visibleContentRect(), occlusion );120 updateContentRect(updater, visibleContentRect(), occlusion, stats); 121 121 } 122 122 -
trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
r123065 r123553 51 51 52 52 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; 54 54 55 55 private: … … 63 63 virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE { return SampledTexelFormatRGBA; } 64 64 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; 66 66 // Sets the rect to invalidate during the next call to prepareToUpdate(). After the next 67 67 // call to prepareToUpdate() the rect is reset. … … 123 123 124 124 // 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; 126 126 127 127 virtual void setTexturePriorities(const WebCore::CCPriorityCalculator&) OVERRIDE; -
trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
r122506 r123553 34 34 #include "WebKit.h" 35 35 #include "cc/CCGraphicsContext.h" 36 #include "cc/CCRenderingStats.h" 36 37 #include "cc/CCTextureUpdater.h" 37 38 #include "platform/WebKitPlatformSupport.h" … … 152 153 bridge.clear(); 153 154 CCTextureUpdater updater; 154 layer->update(updater, 0); 155 CCRenderingStats stats; 156 layer->update(updater, 0, stats); 155 157 } 156 158 157 159 } // namespace 158 -
trunk/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
r123065 r123553 31 31 #include "GraphicsContext.h" 32 32 #include "OpaqueRectTrackingContentLayerDelegate.h" 33 #include "cc/CCRenderingStats.h" 33 34 #include "skia/ext/platform_canvas.h" 34 35 … … 103 104 104 105 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); 106 108 107 109 EXPECT_INT_RECT_EQ(opaqueRectInContentSpace, resultingOpaqueRect); -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r123065 r123553 36 36 #include "WebCompositor.h" 37 37 #include "cc/CCOverdrawMetrics.h" 38 #include "cc/CCRenderingStats.h" 38 39 #include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread 39 40 #include <gtest/gtest.h> … … 95 96 OwnPtr<CCResourceProvider> m_resourceProvider; 96 97 CCTextureUpdater m_updater; 98 CCRenderingStats m_stats; 97 99 FakeTextureCopier m_copier; 98 100 FakeTextureUploader m_uploader; … … 117 119 textureManager->prioritizeTextures(); 118 120 119 layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0 );121 layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); 120 122 updateTextures(); 121 123 layer->pushPropertiesTo(layerImpl.get()); … … 130 132 layer->setTexturePriorities(m_priorityCalculator); 131 133 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); 133 135 layer->pushPropertiesTo(layerImpl.get()); 134 136 … … 155 157 textureManager->prioritizeTextures(); 156 158 157 layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded );159 layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded, m_stats); 158 160 updateTextures(); 159 161 layer->pushPropertiesTo(layerImpl.get()); … … 171 173 // ....but the area is occluded. 172 174 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); 174 176 updateTextures(); 175 177 layer->pushPropertiesTo(layerImpl.get()); … … 199 201 textureManager->prioritizeTextures(); 200 202 201 layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0 );203 layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); 202 204 updateTextures(); 203 205 layer->pushPropertiesTo(layerImpl.get()); … … 221 223 layer->setTexturePriorities(m_priorityCalculator); 222 224 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); 224 226 updateTextures(); 225 227 layer->pushPropertiesTo(layerImpl.get()); … … 250 252 textureManager->prioritizeTextures(); 251 253 252 layer->updateContentRect(m_updater, visibleRect, 0 );254 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 253 255 updateTextures(); 254 256 … … 266 268 textureManager->prioritizeTextures(); 267 269 268 layer->updateContentRect(m_updater, visibleRect, 0 );270 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 269 271 EXPECT_TRUE(layer->needsIdlePaint(visibleRect)); 270 272 updateTextures(); … … 317 319 layer1->setTexturePriorities(m_priorityCalculator); 318 320 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); 321 323 322 324 // We should need idle-painting for both remaining tiles in layer2. … … 335 337 layer1->setTexturePriorities(m_priorityCalculator); 336 338 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); 338 340 339 341 // Oh well, commit the frame and push. … … 355 357 layer1->setTexturePriorities(m_priorityCalculator); 356 358 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); 359 361 360 362 updateTextures(); … … 388 390 layer->setTexturePriorities(m_priorityCalculator); 389 391 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); 391 393 updateTextures(); 392 394 layer->pushPropertiesTo(layerImpl.get()); … … 413 415 layer->setTexturePriorities(m_priorityCalculator); 414 416 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); 416 418 updateTextures(); 417 419 layer->pushPropertiesTo(layerImpl.get()); … … 443 445 textureManager->prioritizeTextures(); 444 446 445 layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0 );447 layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); 446 448 447 449 // Invalidate a tile on layer1 448 450 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); 450 452 451 453 updateTextures(); … … 483 485 // Invalidate a tile on layer2 484 486 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); 487 489 updateTextures(); 488 490 layer1->pushPropertiesTo(layer1Impl.get()); … … 518 520 layer->setTexturePriorities(m_priorityCalculator); 519 521 textureManager->prioritizeTextures(); 520 layer->updateContentRect(m_updater, visibleRect, 0 );522 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 521 523 522 524 // Idle-painting should see no more priority tiles for painting. … … 531 533 layer->setTexturePriorities(m_priorityCalculator); 532 534 textureManager->prioritizeTextures(); 533 layer->updateContentRect(m_updater, visibleRect, 0 );535 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 534 536 535 537 // We shouldn't signal we need another idle paint. … … 560 562 561 563 // Empty layers don't paint or idle-paint. 562 layer->updateContentRect(m_updater, contentRect, 0 );564 layer->updateContentRect(m_updater, contentRect, 0, m_stats); 563 565 564 566 // Empty layers don't have tiles. … … 596 598 layer->setTexturePriorities(m_priorityCalculator); 597 599 textureManager->prioritizeTextures(); 598 layer->updateContentRect(m_updater, visibleRect, 0 );600 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 599 601 600 602 // Non-visible layers don't need idle paint. … … 659 661 textureManager->prioritizeTextures(); 660 662 661 layer->updateContentRect(m_updater, visibleRect, 0 );663 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 662 664 updateTextures(); 663 665 layer->pushPropertiesTo(layerImpl.get()); … … 672 674 textureManager->prioritizeTextures(); 673 675 674 layer->updateContentRect(m_updater, visibleRect, 0 );676 layer->updateContentRect(m_updater, visibleRect, 0, m_stats); 675 677 updateTextures(); 676 678 layer->pushPropertiesTo(layerImpl.get()); … … 695 697 layer->setTexturePriorities(m_priorityCalculator); 696 698 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); 698 700 updateTextures(1000); 699 701 layer->pushPropertiesTo(layerImpl.get()); … … 706 708 // Invoke updateContentRect again. As the layer is valid updateContentRect shouldn't be invoked on 707 709 // 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); 709 711 updateTextures(1000); 710 712 EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount()); … … 714 716 layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get()); 715 717 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); 717 719 updateTextures(1000); 718 720 EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); 719 721 layer->fakeLayerTextureUpdater()->clearPrepareCount(); 720 722 // 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); 722 724 updateTextures(1000); 723 725 EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); … … 746 748 layer->setTexturePriorities(m_priorityCalculator); 747 749 textureManager->prioritizeTextures(); 748 layer->updateContentRect(m_updater, contentBounds, 0 );750 layer->updateContentRect(m_updater, contentBounds, 0, m_stats); 749 751 EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect()); 750 752 updateTextures(); … … 754 756 textureManager->prioritizeTextures(); 755 757 layer->invalidateContentRect(contentBounds); 756 layer->updateContentRect(m_updater, contentBounds, 0 );758 layer->updateContentRect(m_updater, contentBounds, 0, m_stats); 757 759 EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect()); 758 760 updateTextures(); … … 763 765 layer->setTexturePriorities(m_priorityCalculator); 764 766 textureManager->prioritizeTextures(); 765 layer->updateContentRect(m_updater, contentBounds, 0 );767 layer->updateContentRect(m_updater, contentBounds, 0, m_stats); 766 768 EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect()); 767 769 } … … 785 787 layer->setTexturePriorities(m_priorityCalculator); 786 788 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); 788 790 updateTextures(); 789 791 layer->pushPropertiesTo(layerImpl.get()); … … 802 804 layer->setTexturePriorities(m_priorityCalculator); 803 805 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); 805 807 updateTextures(); 806 808 layer->pushPropertiesTo(layerImpl.get()); … … 814 816 layer->setNeedsDisplay(); 815 817 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); 817 819 textureManager->prioritizeTextures(); 818 820 … … 886 888 layer->setTexturePriorities(m_priorityCalculator); 887 889 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); 889 891 890 892 layer->setBounds(IntSize(200, 200)); … … 905 907 layer->setTexturePriorities(m_priorityCalculator); 906 908 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); 908 910 } 909 911 … … 1048 1050 layer->setTexturePriorities(m_priorityCalculator); 1049 1051 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); 1051 1053 EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1052 1054 } … … 1069 1071 layer->setTexturePriorities(m_priorityCalculator); 1070 1072 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); 1072 1074 EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1073 1075 … … 1080 1082 occluded.setOcclusion(IntRect(250, 200, 300, 100)); 1081 1083 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); 1083 1085 EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1084 1086 … … 1091 1093 occluded.setOcclusion(IntRect(250, 250, 300, 100)); 1092 1094 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); 1094 1096 EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1095 1097 … … 1117 1119 layer->setTexturePriorities(m_priorityCalculator); 1118 1120 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); 1120 1122 EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1121 1123 … … 1132 1134 layer->setTexturePriorities(m_priorityCalculator); 1133 1135 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); 1135 1137 EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1136 1138 … … 1147 1149 layer->setTexturePriorities(m_priorityCalculator); 1148 1150 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); 1150 1152 EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1151 1153 … … 1172 1174 layer->setTexturePriorities(m_priorityCalculator); 1173 1175 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); 1175 1177 EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1176 1178 { … … 1186 1188 1187 1189 // 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); 1189 1191 EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1190 1192 … … 1215 1217 layer->setTexturePriorities(m_priorityCalculator); 1216 1218 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); 1218 1220 EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1219 1221 … … 1243 1245 layer->setTexturePriorities(m_priorityCalculator); 1244 1246 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); 1246 1248 // The content is half the size of the layer (so the number of tiles is fewer). 1247 1249 // In this case, the content is 300x300, and since the tile size is 100, the … … 1263 1265 layer->setTexturePriorities(m_priorityCalculator); 1264 1266 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); 1266 1268 EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1267 1269 … … 1283 1285 layer->setTexturePriorities(m_priorityCalculator); 1284 1286 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); 1286 1288 EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1287 1289 … … 1317 1319 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1318 1320 layer->invalidateContentRect(contentBounds); 1319 layer->updateContentRect(m_updater, contentBounds, &occluded );1321 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1320 1322 opaqueContents = layer->visibleContentOpaqueRegion(); 1321 1323 EXPECT_TRUE(opaqueContents.isEmpty()); … … 1330 1332 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect); 1331 1333 layer->invalidateContentRect(contentBounds); 1332 layer->updateContentRect(m_updater, contentBounds, &occluded );1334 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1333 1335 updateTextures(); 1334 1336 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1343 1345 // If we paint again without invalidating, the same stuff should be opaque. 1344 1346 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1345 layer->updateContentRect(m_updater, contentBounds, &occluded );1347 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1346 1348 updateTextures(); 1347 1349 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1358 1360 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1359 1361 layer->invalidateContentRect(IntRect(0, 0, 1, 1)); 1360 layer->updateContentRect(m_updater, contentBounds, &occluded );1362 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1361 1363 updateTextures(); 1362 1364 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1373 1375 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1374 1376 layer->invalidateContentRect(IntRect(10, 10, 1, 1)); 1375 layer->updateContentRect(m_updater, contentBounds, &occluded );1377 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1376 1378 updateTextures(); 1377 1379 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1411 1413 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1412 1414 layer->invalidateContentRect(contentBounds); 1413 layer->updateContentRect(m_updater, contentBounds, &occluded );1415 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1414 1416 updateTextures(); 1415 1417 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1426 1428 layer->invalidateContentRect(IntRect(0, 0, 1, 1)); 1427 1429 layer->invalidateContentRect(IntRect(50, 200, 10, 10)); 1428 layer->updateContentRect(m_updater, contentBounds, &occluded );1430 layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); 1429 1431 updateTextures(); 1430 1432 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1654 1656 1655 1657 // Update the whole tile. 1656 layer->updateContentRect(m_updater, contentRect, 0 );1658 layer->updateContentRect(m_updater, contentRect, 0, m_stats); 1657 1659 layer->trackingLayerPainter()->resetPaintedRect(); 1658 1660 … … 1666 1668 // Invalidate the entire layer in content space. When painting, the rect given to webkit should match the layer's bounds. 1667 1669 layer->invalidateContentRect(contentRect); 1668 layer->updateContentRect(m_updater, contentRect, 0 );1670 layer->updateContentRect(m_updater, contentRect, 0, m_stats); 1669 1671 1670 1672 EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); … … 1689 1691 1690 1692 // Update the whole tile. 1691 layer->updateContentRect(m_updater, contentRect, 0 );1693 layer->updateContentRect(m_updater, contentRect, 0, m_stats); 1692 1694 layer->trackingLayerPainter()->resetPaintedRect(); 1693 1695 … … 1701 1703 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. 1702 1704 layer->setNeedsDisplayRect(layerRect); 1703 layer->updateContentRect(m_updater, contentRect, 0 );1705 layer->updateContentRect(m_updater, contentRect, 0, m_stats); 1704 1706 1705 1707 EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
Note: See TracChangeset
for help on using the changeset viewer.