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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.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 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 m_parent(0), 105 m_parent(0),
106 m_maskLayer(0), 106 m_maskLayer(0),
107 m_contentsClippingMaskLayer(0), 107 m_contentsClippingMaskLayer(0),
108 m_paintCount(0), 108 m_paintCount(0),
109 m_contentsLayer(0), 109 m_contentsLayer(0),
110 m_contentsLayerId(0), 110 m_contentsLayerId(0),
111 m_scrollableArea(nullptr), 111 m_scrollableArea(nullptr),
112 m_renderingContext3d(0), 112 m_renderingContext3d(0),
113 m_colorBehavior(ColorBehavior::transformToGlobalTarget()), 113 m_colorBehavior(ColorBehavior::transformToGlobalTarget()),
114 m_hasPreferredRasterBounds(false) { 114 m_hasPreferredRasterBounds(false) {
115 #if ENABLE(ASSERT) 115 #if DCHECK_IS_ON()
116 if (m_client) 116 if (m_client)
117 m_client->verifyNotPainting(); 117 m_client->verifyNotPainting();
118 #endif 118 #endif
119 119
120 // In true color mode, no inputs are adjusted, and all colors are converted 120 // In true color mode, no inputs are adjusted, and all colors are converted
121 // at rasterization time. 121 // at rasterization time.
122 if (RuntimeEnabledFeatures::trueColorRenderingEnabled()) 122 if (RuntimeEnabledFeatures::trueColorRenderingEnabled())
123 m_colorBehavior = ColorBehavior::tag(); 123 m_colorBehavior = ColorBehavior::tag();
124 124
125 m_contentLayerDelegate = WTF::makeUnique<ContentLayerDelegate>(this); 125 m_contentLayerDelegate = WTF::makeUnique<ContentLayerDelegate>(this);
126 m_layer = Platform::current()->compositorSupport()->createContentLayer( 126 m_layer = Platform::current()->compositorSupport()->createContentLayer(
127 m_contentLayerDelegate.get()); 127 m_contentLayerDelegate.get());
128 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); 128 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
129 m_layer->layer()->setLayerClient(this); 129 m_layer->layer()->setLayerClient(this);
130 } 130 }
131 131
132 GraphicsLayer::~GraphicsLayer() { 132 GraphicsLayer::~GraphicsLayer() {
133 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 133 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
134 m_linkHighlights[i]->clearCurrentGraphicsLayer(); 134 m_linkHighlights[i]->clearCurrentGraphicsLayer();
135 m_linkHighlights.clear(); 135 m_linkHighlights.clear();
136 136
137 #if ENABLE(ASSERT) 137 #if DCHECK_IS_ON()
138 if (m_client) 138 if (m_client)
139 m_client->verifyNotPainting(); 139 m_client->verifyNotPainting();
140 #endif 140 #endif
141 141
142 removeAllChildren(); 142 removeAllChildren();
143 removeFromParent(); 143 removeFromParent();
144 144
145 rasterInvalidationTrackingMap().remove(this); 145 rasterInvalidationTrackingMap().remove(this);
146 DCHECK(!m_parent); 146 DCHECK(!m_parent);
147 } 147 }
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1326 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1327 if (!layer) { 1327 if (!layer) {
1328 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1328 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1329 return; 1329 return;
1330 } 1330 }
1331 1331
1332 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1332 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1333 LOG(INFO) << output.utf8().data(); 1333 LOG(INFO) << output.utf8().data();
1334 } 1334 }
1335 #endif 1335 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698