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

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 330513002: Disentangle updating the ScrollingCoordinator from RenderLayerCompositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix assert Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | no next file » | 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, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 m_overflowControlsHostLayer->addChild(videoLayer); 284 m_overflowControlsHostLayer->addChild(videoLayer);
285 if (GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer()) 285 if (GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer())
286 backgroundLayer->removeFromParent(); 286 backgroundLayer->removeFromParent();
287 } 287 }
288 288
289 void RenderLayerCompositor::updateIfNeeded() 289 void RenderLayerCompositor::updateIfNeeded()
290 { 290 {
291 CompositingUpdateType updateType = m_pendingUpdateType; 291 CompositingUpdateType updateType = m_pendingUpdateType;
292 m_pendingUpdateType = CompositingUpdateNone; 292 m_pendingUpdateType = CompositingUpdateNone;
293 293
294 if (!hasAcceleratedCompositing()) 294 if (!hasAcceleratedCompositing() || updateType == CompositingUpdateNone)
295 return;
296
297 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling Coordinator()->needsToUpdateAfterCompositingChange();
298 if (updateType == CompositingUpdateNone && !needsToUpdateScrollingCoordinato r)
299 return; 295 return;
300 296
301 RenderLayer* updateRoot = rootRenderLayer(); 297 RenderLayer* updateRoot = rootRenderLayer();
302 298
303 Vector<RenderLayer*> layersNeedingRepaint; 299 Vector<RenderLayer*> layersNeedingRepaint;
304 300
305 if (updateType >= CompositingUpdateAfterCompositingInputChange) { 301 if (updateType >= CompositingUpdateAfterCompositingInputChange) {
306 bool layersChanged = false; 302 bool layersChanged = false;
307 { 303 {
308 TRACE_EVENT0("blink_rendering", "CompositingInputsUpdater::update"); 304 TRACE_EVENT0("blink_rendering", "CompositingInputsUpdater::update");
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 355
360 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) 356 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled())
361 applyOverlayFullscreenVideoAdjustment(); 357 applyOverlayFullscreenVideoAdjustment();
362 } 358 }
363 359
364 if (m_needsUpdateFixedBackground) { 360 if (m_needsUpdateFixedBackground) {
365 rootFixedBackgroundsChanged(); 361 rootFixedBackgroundsChanged();
366 m_needsUpdateFixedBackground = false; 362 m_needsUpdateFixedBackground = false;
367 } 363 }
368 364
369 // The scrolling coordinator may realize that it needs updating while compos iting was being updated in this function.
370 needsToUpdateScrollingCoordinator |= scrollingCoordinator() && scrollingCoor dinator()->needsToUpdateAfterCompositingChange();
371 if (needsToUpdateScrollingCoordinator && m_renderView.frame()->isMainFrame() && scrollingCoordinator() && inCompositingMode())
372 scrollingCoordinator()->updateAfterCompositingChange();
373
374 for (unsigned i = 0; i < layersNeedingRepaint.size(); i++) { 365 for (unsigned i = 0; i < layersNeedingRepaint.size(); i++) {
375 RenderLayer* layer = layersNeedingRepaint[i]; 366 RenderLayer* layer = layersNeedingRepaint[i];
376 layer->repainter().computeRepaintRectsIncludingNonCompositingDescendants (); 367 layer->repainter().computeRepaintRectsIncludingNonCompositingDescendants ();
377 368
378 repaintOnCompositingChange(layer); 369 repaintOnCompositingChange(layer);
379 } 370 }
380 371
381 // Inform the inspector that the layer tree has changed. 372 // Inform the inspector that the layer tree has changed.
382 if (m_renderView.frame()->isMainFrame()) 373 if (m_renderView.frame()->isMainFrame())
383 InspectorInstrumentation::layerTreeDidChange(m_renderView.frame()); 374 InspectorInstrumentation::layerTreeDidChange(m_renderView.frame());
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 } else if (graphicsLayer == m_scrollLayer.get()) { 1230 } else if (graphicsLayer == m_scrollLayer.get()) {
1240 name = "LocalFrame Scrolling Layer"; 1231 name = "LocalFrame Scrolling Layer";
1241 } else { 1232 } else {
1242 ASSERT_NOT_REACHED(); 1233 ASSERT_NOT_REACHED();
1243 } 1234 }
1244 1235
1245 return name; 1236 return name;
1246 } 1237 }
1247 1238
1248 } // namespace WebCore 1239 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698