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

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

Issue 1428643004: Repaint on interest rect change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnableSyncPaint
Patch Set: 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 if (offset == m_offsetFromLayoutObject) 286 if (offset == m_offsetFromLayoutObject)
287 return; 287 return;
288 288
289 m_offsetFromLayoutObject = offset; 289 m_offsetFromLayoutObject = offset;
290 290
291 // If the compositing layer offset changes, we need to repaint. 291 // If the compositing layer offset changes, we need to repaint.
292 if (shouldSetNeedsDisplay == SetNeedsDisplay) 292 if (shouldSetNeedsDisplay == SetNeedsDisplay)
293 setNeedsDisplay(); 293 setNeedsDisplay();
294 } 294 }
295 295
296 void GraphicsLayer::paintIfNeeded(GraphicsContext& context) 296 void GraphicsLayer::paint(GraphicsContext& context, const IntRect* clip)
297 { 297 {
298 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); 298 ASSERT(clip || RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnab led());
299
299 if (!m_client) 300 if (!m_client)
300 return; 301 return;
301 if (firstPaintInvalidationTrackingEnabled()) 302 if (firstPaintInvalidationTrackingEnabled())
302 m_debugInfo.clearAnnotatedInvalidateRects();
303 incrementPaintCount();
304 m_client->paintContentsIfNeeded(this, context, m_paintingPhase);
305 notifyFirstPaintToClient();
306 }
307
308 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
309 {
310 if (!m_client)
311 return;
312 if (firstPaintInvalidationTrackingEnabled())
313 m_debugInfo.clearAnnotatedInvalidateRects(); 303 m_debugInfo.clearAnnotatedInvalidateRects();
314 incrementPaintCount(); 304 incrementPaintCount();
315 #ifndef NDEBUG 305 #ifndef NDEBUG
316 if (m_paintController && contentsOpaque() && s_drawDebugRedFill) { 306 if (m_paintController && contentsOpaque() && s_drawDebugRedFill) {
317 FloatRect rect(FloatPoint(), size()); 307 FloatRect rect(FloatPoint(), size());
318 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) { 308 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) {
319 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect); 309 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
320 context.fillRect(rect, SK_ColorRED); 310 context.fillRect(rect, SK_ColorRED);
321 } 311 }
322 } 312 }
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 { 1188 {
1199 if (!layer) { 1189 if (!layer) {
1200 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1190 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1201 return; 1191 return;
1202 } 1192 }
1203 1193
1204 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1194 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1205 fprintf(stderr, "%s\n", output.utf8().data()); 1195 fprintf(stderr, "%s\n", output.utf8().data());
1206 } 1196 }
1207 #endif 1197 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698