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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 1415143005: Preparation for enabling slimming paint synchronized painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix webkit_unit_tests Created 5 years, 1 month 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 void GraphicsLayer::paintIfNeeded(GraphicsContext& context) 296 void GraphicsLayer::paintIfNeeded(GraphicsContext& context)
297 { 297 {
298 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); 298 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
299 if (!m_client) 299 if (!m_client)
300 return; 300 return;
301 if (firstPaintInvalidationTrackingEnabled()) 301 if (firstPaintInvalidationTrackingEnabled())
302 m_debugInfo.clearAnnotatedInvalidateRects(); 302 m_debugInfo.clearAnnotatedInvalidateRects();
303 incrementPaintCount(); 303 incrementPaintCount();
304 #ifndef NDEBUG
305 if (m_paintController && contentsOpaque() && s_drawDebugRedFill) {
306 FloatRect rect(FloatPoint(), size());
307 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) {
308 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
309 context.fillRect(rect, SK_ColorRED);
310 }
311 }
312 #endif
304 m_client->paintContentsIfNeeded(this, context, m_paintingPhase); 313 m_client->paintContentsIfNeeded(this, context, m_paintingPhase);
305 notifyFirstPaintToClient(); 314 notifyFirstPaintToClient();
306 } 315 }
307 316
308 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) 317 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
309 { 318 {
310 if (!m_client) 319 if (!m_client)
311 return; 320 return;
312 if (firstPaintInvalidationTrackingEnabled()) 321 if (firstPaintInvalidationTrackingEnabled())
313 m_debugInfo.clearAnnotatedInvalidateRects(); 322 m_debugInfo.clearAnnotatedInvalidateRects();
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 { 1207 {
1199 if (!layer) { 1208 if (!layer) {
1200 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1209 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1201 return; 1210 return;
1202 } 1211 }
1203 1212
1204 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1213 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1205 fprintf(stderr, "%s\n", output.utf8().data()); 1214 fprintf(stderr, "%s\n", output.utf8().data());
1206 } 1215 }
1207 #endif 1216 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698