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

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

Issue 1393083003: Implement interest rects for synchronized paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if (offset == m_offsetFromLayoutObject) 285 if (offset == m_offsetFromLayoutObject)
286 return; 286 return;
287 287
288 m_offsetFromLayoutObject = offset; 288 m_offsetFromLayoutObject = offset;
289 289
290 // If the compositing layer offset changes, we need to repaint. 290 // If the compositing layer offset changes, we need to repaint.
291 if (shouldSetNeedsDisplay == SetNeedsDisplay) 291 if (shouldSetNeedsDisplay == SetNeedsDisplay)
292 setNeedsDisplay(); 292 setNeedsDisplay();
293 } 293 }
294 294
295 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I ntRect& clip) 295 void GraphicsLayer::paintIfNeeded(GraphicsContext& context)
296 {
297 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
298 if (!m_client)
299 return;
300 if (firstPaintInvalidationTrackingEnabled())
301 m_debugInfo.clearAnnotatedInvalidateRects();
302 incrementPaintCount();
303 m_client->paintContentsIfNeeded(this, context, m_paintingPhase);
304 }
305
306 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
296 { 307 {
297 if (!m_client) 308 if (!m_client)
298 return; 309 return;
299 if (firstPaintInvalidationTrackingEnabled()) 310 if (firstPaintInvalidationTrackingEnabled())
300 m_debugInfo.clearAnnotatedInvalidateRects(); 311 m_debugInfo.clearAnnotatedInvalidateRects();
301 incrementPaintCount(); 312 incrementPaintCount();
302 #ifndef NDEBUG 313 #ifndef NDEBUG
303 if (m_displayItemList && contentsOpaque() && s_drawDebugRedFill) { 314 if (m_displayItemList && contentsOpaque() && s_drawDebugRedFill) {
304 FloatRect rect(FloatPoint(), size()); 315 FloatRect rect(FloatPoint(), size());
305 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) { 316 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) {
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 m_scrollableArea = scrollableArea; 1169 m_scrollableArea = scrollableArea;
1159 1170
1160 // Viewport scrolling may involve pinch zoom and gets routed through 1171 // Viewport scrolling may involve pinch zoom and gets routed through
1161 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll. 1172 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll.
1162 if (isViewport) 1173 if (isViewport)
1163 m_layer->layer()->setScrollClient(0); 1174 m_layer->layer()->setScrollClient(0);
1164 else 1175 else
1165 m_layer->layer()->setScrollClient(this); 1176 m_layer->layer()->setScrollClient(this);
1166 } 1177 }
1167 1178
1168 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
1169 {
1170 paintGraphicsLayerContents(context, clip);
1171 }
1172
1173
1174 void GraphicsLayer::notifyAnimationStarted(double monotonicTime, int group) 1179 void GraphicsLayer::notifyAnimationStarted(double monotonicTime, int group)
1175 { 1180 {
1176 if (m_client) 1181 if (m_client)
1177 m_client->notifyAnimationStarted(this, monotonicTime, group); 1182 m_client->notifyAnimationStarted(this, monotonicTime, group);
1178 } 1183 }
1179 1184
1180 void GraphicsLayer::notifyAnimationFinished(double, int group) 1185 void GraphicsLayer::notifyAnimationFinished(double, int group)
1181 { 1186 {
1182 if (m_scrollableArea) 1187 if (m_scrollableArea)
1183 m_scrollableArea->notifyCompositorAnimationFinished(group); 1188 m_scrollableArea->notifyCompositorAnimationFinished(group);
(...skipping 24 matching lines...) Expand all
1208 { 1213 {
1209 if (!layer) { 1214 if (!layer) {
1210 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1215 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1211 return; 1216 return;
1212 } 1217 }
1213 1218
1214 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1219 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1215 fprintf(stderr, "%s\n", output.utf8().data()); 1220 fprintf(stderr, "%s\n", output.utf8().data());
1216 } 1221 }
1217 #endif 1222 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698