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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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
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 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 } 2464 }
2465 2465
2466 bool CompositedLayerMapping::hasVisibleNonCompositingDescendant( 2466 bool CompositedLayerMapping::hasVisibleNonCompositingDescendant(
2467 PaintLayer* parent) { 2467 PaintLayer* parent) {
2468 if (!parent->hasVisibleDescendant()) 2468 if (!parent->hasVisibleDescendant())
2469 return false; 2469 return false;
2470 2470
2471 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. 2471 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512.
2472 parent->stackingNode()->updateLayerListsIfNeeded(); 2472 parent->stackingNode()->updateLayerListsIfNeeded();
2473 2473
2474 #if ENABLE(ASSERT) 2474 #if DCHECK_IS_ON()
2475 LayerListMutationDetector mutationChecker(parent->stackingNode()); 2475 LayerListMutationDetector mutationChecker(parent->stackingNode());
2476 #endif 2476 #endif
2477 2477
2478 PaintLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(), 2478 PaintLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(),
2479 AllChildren); 2479 AllChildren);
2480 while (PaintLayerStackingNode* curNode = normalFlowIterator.next()) { 2480 while (PaintLayerStackingNode* curNode = normalFlowIterator.next()) {
2481 PaintLayer* curLayer = curNode->layer(); 2481 PaintLayer* curLayer = curNode->layer();
2482 if (curLayer->hasCompositedLayerMapping()) 2482 if (curLayer->hasCompositedLayerMapping())
2483 continue; 2483 continue;
2484 if (curLayer->hasVisibleContent() || 2484 if (curLayer->hasVisibleContent() ||
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
3112 const GraphicsLayer* graphicsLayer, 3112 const GraphicsLayer* graphicsLayer,
3113 GraphicsContext& context, 3113 GraphicsContext& context,
3114 GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, 3114 GraphicsLayerPaintingPhase graphicsLayerPaintingPhase,
3115 const IntRect& interestRect) const { 3115 const IntRect& interestRect) const {
3116 // https://code.google.com/p/chromium/issues/detail?id=343772 3116 // https://code.google.com/p/chromium/issues/detail?id=343772
3117 DisableCompositingQueryAsserts disabler; 3117 DisableCompositingQueryAsserts disabler;
3118 // Allow throttling to make sure no painting paths (e.g., 3118 // Allow throttling to make sure no painting paths (e.g.,
3119 // ContentLayerDelegate::paintContents) try to paint throttled content. 3119 // ContentLayerDelegate::paintContents) try to paint throttled content.
3120 DocumentLifecycle::AllowThrottlingScope allowThrottling( 3120 DocumentLifecycle::AllowThrottlingScope allowThrottling(
3121 m_owningLayer.layoutObject()->document().lifecycle()); 3121 m_owningLayer.layoutObject()->document().lifecycle());
3122 #if ENABLE(ASSERT) 3122 #if DCHECK_IS_ON()
3123 // FIXME: once the state machine is ready, this can be removed and we can 3123 // FIXME: once the state machine is ready, this can be removed and we can
3124 // refer to that instead. 3124 // refer to that instead.
3125 if (Page* page = layoutObject()->frame()->page()) 3125 if (Page* page = layoutObject()->frame()->page())
3126 page->setIsPainting(true); 3126 page->setIsPainting(true);
3127 #endif 3127 #endif
3128 3128
3129 TRACE_EVENT1( 3129 TRACE_EVENT1(
3130 "devtools.timeline,rail", "Paint", "data", 3130 "devtools.timeline,rail", "Paint", "data",
3131 InspectorPaintEvent::data(m_owningLayer.layoutObject(), 3131 InspectorPaintEvent::data(m_owningLayer.layoutObject(),
3132 LayoutRect(interestRect), graphicsLayer)); 3132 LayoutRect(interestRect), graphicsLayer));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
3190 } else if (graphicsLayer == m_squashingLayer.get()) { 3190 } else if (graphicsLayer == m_squashingLayer.get()) {
3191 for (size_t i = 0; i < m_squashedLayers.size(); ++i) 3191 for (size_t i = 0; i < m_squashedLayers.size(); ++i)
3192 doPaintTask(m_squashedLayers[i], *graphicsLayer, paintLayerFlags, context, 3192 doPaintTask(m_squashedLayers[i], *graphicsLayer, paintLayerFlags, context,
3193 interestRect); 3193 interestRect);
3194 } else if (isScrollableAreaLayer(graphicsLayer)) { 3194 } else if (isScrollableAreaLayer(graphicsLayer)) {
3195 paintScrollableArea(graphicsLayer, context, interestRect); 3195 paintScrollableArea(graphicsLayer, context, interestRect);
3196 } 3196 }
3197 InspectorInstrumentation::didPaint(m_owningLayer.layoutObject()->frame(), 3197 InspectorInstrumentation::didPaint(m_owningLayer.layoutObject()->frame(),
3198 graphicsLayer, context, 3198 graphicsLayer, context,
3199 LayoutRect(interestRect)); 3199 LayoutRect(interestRect));
3200 #if ENABLE(ASSERT) 3200 #if DCHECK_IS_ON()
3201 if (Page* page = layoutObject()->frame()->page()) 3201 if (Page* page = layoutObject()->frame()->page())
3202 page->setIsPainting(false); 3202 page->setIsPainting(false);
3203 #endif 3203 #endif
3204 } 3204 }
3205 3205
3206 void CompositedLayerMapping::paintScrollableArea( 3206 void CompositedLayerMapping::paintScrollableArea(
3207 const GraphicsLayer* graphicsLayer, 3207 const GraphicsLayer* graphicsLayer,
3208 GraphicsContext& context, 3208 GraphicsContext& context,
3209 const IntRect& interestRect) const { 3209 const IntRect& interestRect) const {
3210 // Note the composited scrollable area painted here is never associated with a 3210 // Note the composited scrollable area painted here is never associated with a
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3251 return graphicsLayer == layerForHorizontalScrollbar() || 3251 return graphicsLayer == layerForHorizontalScrollbar() ||
3252 graphicsLayer == layerForVerticalScrollbar() || 3252 graphicsLayer == layerForVerticalScrollbar() ||
3253 graphicsLayer == layerForScrollCorner(); 3253 graphicsLayer == layerForScrollCorner();
3254 } 3254 }
3255 3255
3256 bool CompositedLayerMapping::isTrackingRasterInvalidations() const { 3256 bool CompositedLayerMapping::isTrackingRasterInvalidations() const {
3257 GraphicsLayerClient* client = compositor(); 3257 GraphicsLayerClient* client = compositor();
3258 return client ? client->isTrackingRasterInvalidations() : false; 3258 return client ? client->isTrackingRasterInvalidations() : false;
3259 } 3259 }
3260 3260
3261 #if ENABLE(ASSERT) 3261 #if DCHECK_IS_ON()
3262 void CompositedLayerMapping::verifyNotPainting() { 3262 void CompositedLayerMapping::verifyNotPainting() {
3263 ASSERT(!layoutObject()->frame()->page() || 3263 ASSERT(!layoutObject()->frame()->page() ||
3264 !layoutObject()->frame()->page()->isPainting()); 3264 !layoutObject()->frame()->page()->isPainting());
3265 } 3265 }
3266 #endif 3266 #endif
3267 3267
3268 // Only used for performance benchmark testing. Intended to be a 3268 // Only used for performance benchmark testing. Intended to be a
3269 // sufficiently-unique element id name to allow picking out the target element 3269 // sufficiently-unique element id name to allow picking out the target element
3270 // for invalidation. 3270 // for invalidation.
3271 static const char* kTestPaintInvalidationTargetName = 3271 static const char* kTestPaintInvalidationTargetName =
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 } 3358 }
3359 3359
3360 // Assert on incorrect mappings between layers and groups 3360 // Assert on incorrect mappings between layers and groups
3361 ASSERT(layerIndex < m_squashedLayers.size()); 3361 ASSERT(layerIndex < m_squashedLayers.size());
3362 if (layerIndex == m_squashedLayers.size()) 3362 if (layerIndex == m_squashedLayers.size())
3363 return; 3363 return;
3364 3364
3365 m_squashedLayers.remove(layerIndex); 3365 m_squashedLayers.remove(layerIndex);
3366 } 3366 }
3367 3367
3368 #if ENABLE(ASSERT) 3368 #if DCHECK_IS_ON()
3369 bool CompositedLayerMapping::verifyLayerInSquashingVector( 3369 bool CompositedLayerMapping::verifyLayerInSquashingVector(
3370 const PaintLayer* layer) { 3370 const PaintLayer* layer) {
3371 for (size_t layerIndex = 0; layerIndex < m_squashedLayers.size(); 3371 for (size_t layerIndex = 0; layerIndex < m_squashedLayers.size();
3372 ++layerIndex) { 3372 ++layerIndex) {
3373 if (m_squashedLayers[layerIndex].paintLayer == layer) 3373 if (m_squashedLayers[layerIndex].paintLayer == layer)
3374 return true; 3374 return true;
3375 } 3375 }
3376 3376
3377 return false; 3377 return false;
3378 } 3378 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
3444 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3444 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3445 name = "Decoration Layer"; 3445 name = "Decoration Layer";
3446 } else { 3446 } else {
3447 ASSERT_NOT_REACHED(); 3447 ASSERT_NOT_REACHED();
3448 } 3448 }
3449 3449
3450 return name; 3450 return name;
3451 } 3451 }
3452 3452
3453 } // namespace blink 3453 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698