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

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

Issue 1441973003: Use recomputed interest rect only if it changed enough (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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::paint(GraphicsContext& context, const IntRect* clip) 296 void GraphicsLayer::paint(GraphicsContext& context, const IntRect* interestRect)
297 { 297 {
298 ASSERT(clip || RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnab led()); 298 ASSERT(interestRect || RuntimeEnabledFeatures::slimmingPaintSynchronizedPain tingEnabled());
299 ASSERT(drawsContent()); 299 ASSERT(drawsContent());
300 300
301 if (!m_client) 301 if (!m_client)
302 return; 302 return;
303 if (firstPaintInvalidationTrackingEnabled()) 303 if (firstPaintInvalidationTrackingEnabled())
304 m_debugInfo.clearAnnotatedInvalidateRects(); 304 m_debugInfo.clearAnnotatedInvalidateRects();
305 incrementPaintCount(); 305 incrementPaintCount();
306 #ifndef NDEBUG 306 #ifndef NDEBUG
307 if (m_paintController && contentsOpaque() && s_drawDebugRedFill) { 307 if (m_paintController && contentsOpaque() && s_drawDebugRedFill) {
308 FloatRect rect(FloatPoint(), size()); 308 FloatRect rect(FloatPoint(), size());
309 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) { 309 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) {
310 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect); 310 DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
311 context.fillRect(rect, SK_ColorRED); 311 context.fillRect(rect, SK_ColorRED);
312 } 312 }
313 } 313 }
314 #endif 314 #endif
315 m_client->paintContents(this, context, m_paintingPhase, clip); 315 m_previousInterestRect = m_client->paintContents(this, context, m_paintingPh ase, interestRect);
316 notifyFirstPaintToClient(); 316 notifyFirstPaintToClient();
317 } 317 }
318 318
319 void GraphicsLayer::notifyFirstPaintToClient() 319 void GraphicsLayer::notifyFirstPaintToClient()
320 { 320 {
321 if (!m_painted) { 321 if (!m_painted) {
322 m_painted = true; 322 m_painted = true;
323 m_client->notifyFirstPaint(); 323 m_client->notifyFirstPaint();
324 } 324 }
325 if (!m_textPainted && m_paintController->textPainted()) { 325 if (!m_textPainted && m_paintController->textPainted()) {
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 { 1192 {
1193 if (!layer) { 1193 if (!layer) {
1194 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1194 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1195 return; 1195 return;
1196 } 1196 }
1197 1197
1198 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1198 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1199 fprintf(stderr, "%s\n", output.utf8().data()); 1199 fprintf(stderr, "%s\n", output.utf8().data());
1200 } 1200 }
1201 #endif 1201 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698