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

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

Issue 1471353002: Paint red fill after checking CachedDisplayItemList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on https://codereview.chromium.org/1469123005/ Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 { 306 {
307 ASSERT(interestRect || RuntimeEnabledFeatures::slimmingPaintSynchronizedPain tingEnabled()); 307 ASSERT(interestRect || RuntimeEnabledFeatures::slimmingPaintSynchronizedPain tingEnabled());
308 ASSERT(drawsContent()); 308 ASSERT(drawsContent());
309 ASSERT(&context.paintController() == m_paintController); 309 ASSERT(&context.paintController() == m_paintController);
310 310
311 if (!m_client) 311 if (!m_client)
312 return; 312 return;
313 if (firstPaintInvalidationTrackingEnabled()) 313 if (firstPaintInvalidationTrackingEnabled())
314 m_debugInfo.clearAnnotatedInvalidateRects(); 314 m_debugInfo.clearAnnotatedInvalidateRects();
315 incrementPaintCount(); 315 incrementPaintCount();
316 #ifndef NDEBUG
317 if (contentsOpaque() && s_drawDebugRedFill) {
318 FloatRect rect(FloatPoint(), size());
319 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) {
320 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
321 context.fillRect(rect, SK_ColorRED);
322 }
323 }
324 #endif
325 316
326 IntRect newInterestRect; 317 IntRect newInterestRect;
327 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { 318 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
328 if (!interestRect) { 319 if (!interestRect) {
329 newInterestRect = m_client->computeInterestRect(this, m_previousInte restRect); 320 newInterestRect = m_client->computeInterestRect(this, m_previousInte restRect);
330 interestRect = &newInterestRect; 321 interestRect = &newInterestRect;
331 } 322 }
332 if (!m_client->needsRepaint() && !paintController()->cacheIsEmpty() && m _previousInterestRect == *interestRect) { 323 if (!m_client->needsRepaint() && !paintController()->cacheIsEmpty() && m _previousInterestRect == *interestRect) {
333 paintController()->createAndAppend<CachedDisplayItem>(*this, Display Item::CachedDisplayItemList); 324 paintController()->createAndAppend<CachedDisplayItem>(*this, Display Item::CachedDisplayItemList);
334 return; 325 return;
335 } 326 }
336 } 327 }
337 328
329 #ifndef NDEBUG
330 if (contentsOpaque() && s_drawDebugRedFill) {
331 FloatRect rect(FloatPoint(), size());
332 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) {
333 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
334 context.fillRect(rect, SK_ColorRED);
335 }
336 }
337 #endif
338
338 m_previousInterestRect = *interestRect; 339 m_previousInterestRect = *interestRect;
339 m_client->paintContents(this, context, m_paintingPhase, *interestRect); 340 m_client->paintContents(this, context, m_paintingPhase, *interestRect);
340 notifyFirstPaintToClient(); 341 notifyFirstPaintToClient();
341 } 342 }
342 343
343 void GraphicsLayer::notifyFirstPaintToClient() 344 void GraphicsLayer::notifyFirstPaintToClient()
344 { 345 {
345 if (!m_painted) { 346 if (!m_painted) {
346 m_painted = true; 347 m_painted = true;
347 m_client->notifyFirstPaint(); 348 m_client->notifyFirstPaint();
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 { 1222 {
1222 if (!layer) { 1223 if (!layer) {
1223 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1224 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1224 return; 1225 return;
1225 } 1226 }
1226 1227
1227 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1228 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1228 fprintf(stderr, "%s\n", output.utf8().data()); 1229 fprintf(stderr, "%s\n", output.utf8().data());
1229 } 1230 }
1230 #endif 1231 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698