Changeset 116481 in webkit
- Timestamp:
- May 8, 2012 7:26:23 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116480 r116481 1 2012-05-08 Dana Jansens <danakj@chromium.org> 2 3 [chromium] Show borders for partial-draw-culled quads to visualize culling behaviour 4 https://bugs.webkit.org/show_bug.cgi?id=85414 5 6 Reviewed by Adrienne Walker. 7 8 The borders are brown, and are only shown when the quad's visible rect 9 is non-empty and is different from the quad's original rect. 10 11 Adds a flag to CCQuadCuller constructor, to enable showing debug borders 12 around what it leaves after culling (when it culls anything in a quad 13 at all). 14 15 * platform/graphics/chromium/cc/CCDrawQuad.h: 16 (WebCore::CCDrawQuad::isDebugQuad): 17 (WebCore::CCDrawQuad::sharedQuadState): 18 (CCDrawQuad): 19 * platform/graphics/chromium/cc/CCQuadCuller.cpp: 20 (WebCore): 21 (WebCore::CCQuadCuller::CCQuadCuller): 22 (WebCore::appendQuadInternal): 23 (WebCore::CCQuadCuller::append): 24 (WebCore::CCQuadCuller::appendSurface): 25 (WebCore::CCQuadCuller::appendReplica): 26 * platform/graphics/chromium/cc/CCQuadCuller.h: 27 (CCQuadCuller): 28 * platform/graphics/chromium/cc/CCRenderPass.cpp: 29 (WebCore::CCRenderPass::appendQuadsForLayer): 30 (WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer): 31 1 32 2012-05-08 Julien Chaffraix <jchaffraix@webkit.org> 2 33 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
r115394 r116481 76 76 77 77 Material material() const { return m_material; } 78 bool isDebugQuad() const { return m_material == DebugBorder; } 78 79 79 80 const CCCheckerboardDrawQuad* toCheckerboardDrawQuad() const; … … 85 86 const CCTileDrawQuad* toTileDrawQuad() const; 86 87 const CCVideoDrawQuad* toVideoDrawQuad() const; 88 89 const CCSharedQuadState* sharedQuadState() const { return m_sharedQuadState; } 87 90 88 91 protected: -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
r115930 r116481 32 32 #include "Region.h" 33 33 #include "TransformationMatrix.h" 34 #include "cc/CCDebugBorderDrawQuad.h" 34 35 #include "cc/CCLayerImpl.h" 35 36 #include "cc/CCOverdrawMetrics.h" … … 41 42 namespace WebCore { 42 43 43 CCQuadCuller::CCQuadCuller(CCQuadList& quadList, CCLayerImpl* layer, const CCOcclusionTrackerImpl* occlusionTracker) 44 static const int debugTileBorderWidth = 1; 45 static const int debugTileBorderAlpha = 120; 46 static const int debugTileBorderColorRed = 160; 47 static const int debugTileBorderColorGreen = 100; 48 static const int debugTileBorderColorBlue = 0; 49 50 CCQuadCuller::CCQuadCuller(CCQuadList& quadList, CCLayerImpl* layer, const CCOcclusionTrackerImpl* occlusionTracker, bool showCullingWithDebugBorderQuads) 44 51 : m_quadList(quadList) 45 52 , m_layer(layer) 46 53 , m_occlusionTracker(occlusionTracker) 54 , m_showCullingWithDebugBorderQuads(showCullingWithDebugBorderQuads) 47 55 { 48 56 } 49 57 50 static inline bool appendQuadInternal(PassOwnPtr<CCDrawQuad> passDrawQuad, const IntRect& culledRect, CCQuadList& quadList, const CCOcclusionTrackerImpl& occlusionTracker )58 static inline bool appendQuadInternal(PassOwnPtr<CCDrawQuad> passDrawQuad, const IntRect& culledRect, CCQuadList& quadList, const CCOcclusionTrackerImpl& occlusionTracker, bool createDebugBorderQuads) 51 59 { 52 60 OwnPtr<CCDrawQuad> drawQuad(passDrawQuad); … … 58 66 occlusionTracker.overdrawMetrics().didDraw(drawQuad->quadTransform(), culledRect, drawQuad->opaqueRect()); 59 67 60 // Release the quad after we're done using it. 61 if (keepQuad) 68 if (keepQuad) { 69 if (createDebugBorderQuads && !drawQuad->isDebugQuad() && drawQuad->quadVisibleRect() != drawQuad->quadRect()) { 70 Color borderColor = Color(debugTileBorderColorRed, debugTileBorderColorGreen, debugTileBorderColorBlue, debugTileBorderAlpha); 71 quadList.append(CCDebugBorderDrawQuad::create(drawQuad->sharedQuadState(), drawQuad->quadVisibleRect(), borderColor, debugTileBorderWidth)); 72 } 73 74 // Release the quad after we're done using it. 62 75 quadList.append(drawQuad.release()); 76 } 63 77 return keepQuad; 64 78 } … … 67 81 { 68 82 IntRect culledRect = m_occlusionTracker->unoccludedContentRect(m_layer, passDrawQuad->quadRect()); 69 return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker );83 return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads); 70 84 } 71 85 … … 73 87 { 74 88 IntRect culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRect(m_layer->renderSurface(), false, passDrawQuad->quadRect()); 75 return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker );89 return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads); 76 90 } 77 91 … … 79 93 { 80 94 IntRect culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRect(m_layer->renderSurface(), true, passDrawQuad->quadRect()); 81 return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker );95 return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads); 82 96 } 83 97 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
r113652 r116481 37 37 // Passing 0 for CCOverdrawCounts* is valid, and disable the extra computation 38 38 // done to estimate over draw statistics. 39 CCQuadCuller(CCQuadList&, CCLayerImpl*, const CCOcclusionTrackerImpl* );39 CCQuadCuller(CCQuadList&, CCLayerImpl*, const CCOcclusionTrackerImpl*, bool showCullingWithDebugBorderQuads); 40 40 41 41 // Returns true if the quad is added to the list, and false if the quad is entirely culled. … … 48 48 CCLayerImpl* m_layer; 49 49 const CCOcclusionTrackerImpl* m_occlusionTracker; 50 bool m_showCullingWithDebugBorderQuads; 50 51 }; 51 52 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
r113871 r116481 61 61 void CCRenderPass::appendQuadsForLayer(CCLayerImpl* layer, CCOcclusionTrackerImpl* occlusionTracker, bool& hadMissingTiles) 62 62 { 63 CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker );63 CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker, layer->hasDebugBorders()); 64 64 65 65 OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(); … … 73 73 // FIXME: render surface layers should be a CCLayerImpl-derived class and 74 74 // not be handled specially here. 75 CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker );75 CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker, layer->hasDebugBorders()); 76 76 77 77 CCRenderSurface* surface = layer->renderSurface(); -
trunk/Source/WebKit/chromium/ChangeLog
r116474 r116481 1 2012-05-08 Dana Jansens <danakj@chromium.org> 2 3 [chromium] Show borders for partial-draw-culled quads to visualize culling behaviour 4 https://bugs.webkit.org/show_bug.cgi?id=85414 5 6 Reviewed by Adrienne Walker. 7 8 * tests/CCQuadCullerTest.cpp: 9 (WebCore::appendQuads): 10 * tests/MockCCQuadCuller.h: 11 (WebCore::MockCCQuadCuller::MockCCQuadCuller): 12 1 13 2012-05-08 Tony Chang <tony@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
r114601 r116481 92 92 { 93 93 occlusionTracker.enterLayer(it); 94 CCQuadCuller quadCuller(quadList, layer, &occlusionTracker );94 CCQuadCuller quadCuller(quadList, layer, &occlusionTracker, false); 95 95 OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(); 96 96 bool hadMissingTiles = false; -
trunk/Source/WebKit/chromium/tests/MockCCQuadCuller.h
r111700 r116481 36 36 public: 37 37 MockCCQuadCuller() 38 : CCQuadCuller(m_quadListStorage, 0, 0 )38 : CCQuadCuller(m_quadListStorage, 0, 0, false) 39 39 , m_activeQuadList(m_quadListStorage) 40 40 { } 41 41 42 42 explicit MockCCQuadCuller(CCQuadList& externalQuadList) 43 : CCQuadCuller(externalQuadList, 0, 0 )43 : CCQuadCuller(externalQuadList, 0, 0, false) 44 44 , m_activeQuadList(externalQuadList) 45 45 { }
Note: See TracChangeset
for help on using the changeset viewer.