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

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: Rebased. 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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 dirtyRect.move(offset); 2011 dirtyRect.move(offset);
2012 2012
2013 if (!(paintInfo.paintingPhase & GraphicsLayerPaintOverflowContents)) { 2013 if (!(paintInfo.paintingPhase & GraphicsLayerPaintOverflowContents)) {
2014 LayoutRect bounds = paintInfo.compositedBounds; 2014 LayoutRect bounds = paintInfo.compositedBounds;
2015 bounds.move(paintInfo.renderLayer->subpixelAccumulation()); 2015 bounds.move(paintInfo.renderLayer->subpixelAccumulation());
2016 dirtyRect.intersect(pixelSnappedIntRect(bounds)); 2016 dirtyRect.intersect(pixelSnappedIntRect(bounds));
2017 } else { 2017 } else {
2018 dirtyRect.move(roundedIntSize(paintInfo.renderLayer->subpixelAccumulatio n())); 2018 dirtyRect.move(roundedIntSize(paintInfo.renderLayer->subpixelAccumulatio n()));
2019 } 2019 }
2020 2020
2021 #ifndef NDEBUG 2021 #if ENABLE(ASSERT)
2022 paintInfo.renderLayer->renderer()->assertSubtreeIsLaidOut(); 2022 paintInfo.renderLayer->renderer()->assertSubtreeIsLaidOut();
2023 #endif 2023 #endif
2024 2024
2025 if (paintInfo.renderLayer->compositingState() != PaintsIntoGroupedBacking) { 2025 if (paintInfo.renderLayer->compositingState() != PaintsIntoGroupedBacking) {
2026 // FIXME: GraphicsLayers need a way to split for RenderRegions. 2026 // FIXME: GraphicsLayers need a way to split for RenderRegions.
2027 LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBe haviorNormal, paintInfo.renderLayer->subpixelAccumulation()); 2027 LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBe haviorNormal, paintInfo.renderLayer->subpixelAccumulation());
2028 paintInfo.renderLayer->paintLayerContents(context, paintingInfo, paintFl ags); 2028 paintInfo.renderLayer->paintLayerContents(context, paintingInfo, paintFl ags);
2029 2029
2030 ASSERT(!paintInfo.isBackgroundLayer || paintFlags & PaintLayerPaintingRo otBackgroundOnly); 2030 ASSERT(!paintInfo.isBackgroundLayer || paintFlags & PaintLayerPaintingRo otBackgroundOnly);
2031 2031
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 transformedClip.moveBy(scrollbarRect.location()); 2063 transformedClip.moveBy(scrollbarRect.location());
2064 scrollbar->paint(&context, transformedClip); 2064 scrollbar->paint(&context, transformedClip);
2065 context.restore(); 2065 context.restore();
2066 } 2066 }
2067 2067
2068 // Up-call from compositing layer drawing callback. 2068 // Up-call from compositing layer drawing callback.
2069 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const IntRect & clip) 2069 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const IntRect & clip)
2070 { 2070 {
2071 // https://code.google.com/p/chromium/issues/detail?id=343772 2071 // https://code.google.com/p/chromium/issues/detail?id=343772
2072 DisableCompositingQueryAsserts disabler; 2072 DisableCompositingQueryAsserts disabler;
2073 #ifndef NDEBUG 2073 #if ENABLE(ASSERT)
2074 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead. 2074 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead.
2075 if (Page* page = renderer()->frame()->page()) 2075 if (Page* page = renderer()->frame()->page())
2076 page->setIsPainting(true); 2076 page->setIsPainting(true);
2077 #endif 2077 #endif
2078 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(m_owningLayer.renderer(), clip, graphicsLayer)); 2078 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(m_owningLayer.renderer(), clip, graphicsLayer));
2079 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", "stack", InspectorCallStackEvent::currentCallStack()); 2079 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", "stack", InspectorCallStackEvent::currentCallStack());
2080 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 2080 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
2081 InspectorInstrumentation::willPaint(m_owningLayer.renderer(), graphicsLayer) ; 2081 InspectorInstrumentation::willPaint(m_owningLayer.renderer(), graphicsLayer) ;
2082 2082
2083 if (graphicsLayer == m_graphicsLayer.get() 2083 if (graphicsLayer == m_graphicsLayer.get()
(...skipping 25 matching lines...) Expand all
2109 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()-> scrollCornerAndResizerRect(); 2109 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()-> scrollCornerAndResizerRect();
2110 context.save(); 2110 context.save();
2111 context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y ()); 2111 context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y ());
2112 IntRect transformedClip = clip; 2112 IntRect transformedClip = clip;
2113 transformedClip.moveBy(scrollCornerAndResizer.location()); 2113 transformedClip.moveBy(scrollCornerAndResizer.location());
2114 m_owningLayer.scrollableArea()->paintScrollCorner(&context, IntPoint(), transformedClip); 2114 m_owningLayer.scrollableArea()->paintScrollCorner(&context, IntPoint(), transformedClip);
2115 m_owningLayer.scrollableArea()->paintResizer(&context, IntPoint(), trans formedClip); 2115 m_owningLayer.scrollableArea()->paintResizer(&context, IntPoint(), trans formedClip);
2116 context.restore(); 2116 context.restore();
2117 } 2117 }
2118 InspectorInstrumentation::didPaint(m_owningLayer.renderer(), graphicsLayer, &context, clip); 2118 InspectorInstrumentation::didPaint(m_owningLayer.renderer(), graphicsLayer, &context, clip);
2119 #ifndef NDEBUG 2119 #if ENABLE(ASSERT)
2120 if (Page* page = renderer()->frame()->page()) 2120 if (Page* page = renderer()->frame()->page())
2121 page->setIsPainting(false); 2121 page->setIsPainting(false);
2122 #endif 2122 #endif
2123 } 2123 }
2124 2124
2125 bool CompositedLayerMapping::isTrackingRepaints() const 2125 bool CompositedLayerMapping::isTrackingRepaints() const
2126 { 2126 {
2127 GraphicsLayerClient* client = compositor(); 2127 GraphicsLayerClient* client = compositor();
2128 return client ? client->isTrackingRepaints() : false; 2128 return client ? client->isTrackingRepaints() : false;
2129 } 2129 }
2130 2130
2131 #ifndef NDEBUG 2131 #if ENABLE(ASSERT)
2132 void CompositedLayerMapping::verifyNotPainting() 2132 void CompositedLayerMapping::verifyNotPainting()
2133 { 2133 {
2134 ASSERT(!renderer()->frame()->page() || !renderer()->frame()->page()->isPaint ing()); 2134 ASSERT(!renderer()->frame()->page() || !renderer()->frame()->page()->isPaint ing());
2135 } 2135 }
2136 #endif 2136 #endif
2137 2137
2138 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double monotonicTime) 2138 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double monotonicTime)
2139 { 2139 {
2140 renderer()->node()->document().compositorPendingAnimations().notifyComposito rAnimationStarted(monotonicTime); 2140 renderer()->node()->document().compositorPendingAnimations().notifyComposito rAnimationStarted(monotonicTime);
2141 } 2141 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2240 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2241 name = "Scrolling Block Selection Layer"; 2241 name = "Scrolling Block Selection Layer";
2242 } else { 2242 } else {
2243 ASSERT_NOT_REACHED(); 2243 ASSERT_NOT_REACHED();
2244 } 2244 }
2245 2245
2246 return name; 2246 return name;
2247 } 2247 }
2248 2248
2249 } // namespace WebCore 2249 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698