Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed config.gni. Minor cleanups. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 } 1628 }
1629 1629
1630 bool CompositedLayerMapping::hasVisibleNonCompositingDescendant(RenderLayer* par ent) 1630 bool CompositedLayerMapping::hasVisibleNonCompositingDescendant(RenderLayer* par ent)
1631 { 1631 {
1632 if (!parent->hasVisibleDescendant()) 1632 if (!parent->hasVisibleDescendant())
1633 return false; 1633 return false;
1634 1634
1635 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. 1635 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512.
1636 parent->stackingNode()->updateLayerListsIfNeeded(); 1636 parent->stackingNode()->updateLayerListsIfNeeded();
1637 1637
1638 #if ASSERT_ENABLED 1638 #if ENABLE(ASSERT)
1639 LayerListMutationDetector mutationChecker(parent->stackingNode()); 1639 LayerListMutationDetector mutationChecker(parent->stackingNode());
1640 #endif 1640 #endif
1641 1641
1642 RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(), AllChildren); 1642 RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(), AllChildren);
1643 while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) { 1643 while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) {
1644 RenderLayer* curLayer = curNode->layer(); 1644 RenderLayer* curLayer = curNode->layer();
1645 if (curLayer->hasCompositedLayerMapping()) 1645 if (curLayer->hasCompositedLayerMapping())
1646 continue; 1646 continue;
1647 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant( curLayer)) 1647 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant( curLayer))
1648 return true; 1648 return true;
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2014 dirtyRect.move(offset); 2014 dirtyRect.move(offset);
2015 2015
2016 if (!(paintInfo.paintingPhase & GraphicsLayerPaintOverflowContents)) { 2016 if (!(paintInfo.paintingPhase & GraphicsLayerPaintOverflowContents)) {
2017 LayoutRect bounds = paintInfo.compositedBounds; 2017 LayoutRect bounds = paintInfo.compositedBounds;
2018 bounds.move(paintInfo.renderLayer->subpixelAccumulation()); 2018 bounds.move(paintInfo.renderLayer->subpixelAccumulation());
2019 dirtyRect.intersect(pixelSnappedIntRect(bounds)); 2019 dirtyRect.intersect(pixelSnappedIntRect(bounds));
2020 } else { 2020 } else {
2021 dirtyRect.move(roundedIntSize(paintInfo.renderLayer->subpixelAccumulatio n())); 2021 dirtyRect.move(roundedIntSize(paintInfo.renderLayer->subpixelAccumulatio n()));
2022 } 2022 }
2023 2023
2024 #ifndef NDEBUG 2024 #if ENABLE(ASSERT)
2025 paintInfo.renderLayer->renderer()->assertSubtreeIsLaidOut(); 2025 paintInfo.renderLayer->renderer()->assertSubtreeIsLaidOut();
2026 #endif 2026 #endif
2027 2027
2028 if (paintInfo.renderLayer->compositingState() != PaintsIntoGroupedBacking) { 2028 if (paintInfo.renderLayer->compositingState() != PaintsIntoGroupedBacking) {
2029 // FIXME: GraphicsLayers need a way to split for RenderRegions. 2029 // FIXME: GraphicsLayers need a way to split for RenderRegions.
2030 LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBe haviorNormal, paintInfo.renderLayer->subpixelAccumulation()); 2030 LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBe haviorNormal, paintInfo.renderLayer->subpixelAccumulation());
2031 paintInfo.renderLayer->paintLayerContents(context, paintingInfo, paintFl ags); 2031 paintInfo.renderLayer->paintLayerContents(context, paintingInfo, paintFl ags);
2032 2032
2033 ASSERT(!paintInfo.isBackgroundLayer || paintFlags & PaintLayerPaintingRo otBackgroundOnly); 2033 ASSERT(!paintInfo.isBackgroundLayer || paintFlags & PaintLayerPaintingRo otBackgroundOnly);
2034 2034
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 transformedClip.moveBy(scrollbarRect.location()); 2066 transformedClip.moveBy(scrollbarRect.location());
2067 scrollbar->paint(&context, transformedClip); 2067 scrollbar->paint(&context, transformedClip);
2068 context.restore(); 2068 context.restore();
2069 } 2069 }
2070 2070
2071 // Up-call from compositing layer drawing callback. 2071 // Up-call from compositing layer drawing callback.
2072 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const IntRect & clip) 2072 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const IntRect & clip)
2073 { 2073 {
2074 // https://code.google.com/p/chromium/issues/detail?id=343772 2074 // https://code.google.com/p/chromium/issues/detail?id=343772
2075 DisableCompositingQueryAsserts disabler; 2075 DisableCompositingQueryAsserts disabler;
2076 #ifndef NDEBUG 2076 #if ENABLE(ASSERT)
2077 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead. 2077 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead.
2078 if (Page* page = renderer()->frame()->page()) 2078 if (Page* page = renderer()->frame()->page())
2079 page->setIsPainting(true); 2079 page->setIsPainting(true);
2080 #endif 2080 #endif
2081 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(m_owningLayer.renderer(), clip, graphicsLayer)); 2081 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(m_owningLayer.renderer(), clip, graphicsLayer));
2082 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", "stack", InspectorCallStackEvent::currentCallStack()); 2082 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", "stack", InspectorCallStackEvent::currentCallStack());
2083 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 2083 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
2084 InspectorInstrumentation::willPaint(m_owningLayer.renderer(), graphicsLayer) ; 2084 InspectorInstrumentation::willPaint(m_owningLayer.renderer(), graphicsLayer) ;
2085 2085
2086 if (graphicsLayer == m_graphicsLayer.get() 2086 if (graphicsLayer == m_graphicsLayer.get()
(...skipping 25 matching lines...) Expand all
2112 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()-> scrollCornerAndResizerRect(); 2112 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()-> scrollCornerAndResizerRect();
2113 context.save(); 2113 context.save();
2114 context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y ()); 2114 context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y ());
2115 IntRect transformedClip = clip; 2115 IntRect transformedClip = clip;
2116 transformedClip.moveBy(scrollCornerAndResizer.location()); 2116 transformedClip.moveBy(scrollCornerAndResizer.location());
2117 m_owningLayer.scrollableArea()->paintScrollCorner(&context, IntPoint(), transformedClip); 2117 m_owningLayer.scrollableArea()->paintScrollCorner(&context, IntPoint(), transformedClip);
2118 m_owningLayer.scrollableArea()->paintResizer(&context, IntPoint(), trans formedClip); 2118 m_owningLayer.scrollableArea()->paintResizer(&context, IntPoint(), trans formedClip);
2119 context.restore(); 2119 context.restore();
2120 } 2120 }
2121 InspectorInstrumentation::didPaint(m_owningLayer.renderer(), graphicsLayer, &context, clip); 2121 InspectorInstrumentation::didPaint(m_owningLayer.renderer(), graphicsLayer, &context, clip);
2122 #ifndef NDEBUG 2122 #if ENABLE(ASSERT)
2123 if (Page* page = renderer()->frame()->page()) 2123 if (Page* page = renderer()->frame()->page())
2124 page->setIsPainting(false); 2124 page->setIsPainting(false);
2125 #endif 2125 #endif
2126 } 2126 }
2127 2127
2128 bool CompositedLayerMapping::isTrackingRepaints() const 2128 bool CompositedLayerMapping::isTrackingRepaints() const
2129 { 2129 {
2130 GraphicsLayerClient* client = compositor(); 2130 GraphicsLayerClient* client = compositor();
2131 return client ? client->isTrackingRepaints() : false; 2131 return client ? client->isTrackingRepaints() : false;
2132 } 2132 }
2133 2133
2134 #ifndef NDEBUG 2134 #if ENABLE(ASSERT)
2135 void CompositedLayerMapping::verifyNotPainting() 2135 void CompositedLayerMapping::verifyNotPainting()
2136 { 2136 {
2137 ASSERT(!renderer()->frame()->page() || !renderer()->frame()->page()->isPaint ing()); 2137 ASSERT(!renderer()->frame()->page() || !renderer()->frame()->page()->isPaint ing());
2138 } 2138 }
2139 #endif 2139 #endif
2140 2140
2141 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double monotonicTime) 2141 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double monotonicTime)
2142 { 2142 {
2143 renderer()->node()->document().compositorPendingAnimations().notifyComposito rAnimationStarted(monotonicTime); 2143 renderer()->node()->document().compositorPendingAnimations().notifyComposito rAnimationStarted(monotonicTime);
2144 } 2144 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2243 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2243 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2244 name = "Scrolling Block Selection Layer"; 2244 name = "Scrolling Block Selection Layer";
2245 } else { 2245 } else {
2246 ASSERT_NOT_REACHED(); 2246 ASSERT_NOT_REACHED();
2247 } 2247 }
2248 2248
2249 return name; 2249 return name;
2250 } 2250 }
2251 2251
2252 } // namespace WebCore 2252 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698