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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 2285253003: Move TopDocumentRootScrollerController to a separate object on FrameHost (Closed)
Patch Set: None Created 4 years, 3 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, 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/layout/api/LayoutViewItem.h" 44 #include "core/layout/api/LayoutViewItem.h"
45 #include "core/layout/compositing/CompositedLayerMapping.h" 45 #include "core/layout/compositing/CompositedLayerMapping.h"
46 #include "core/layout/compositing/CompositingInputsUpdater.h" 46 #include "core/layout/compositing/CompositingInputsUpdater.h"
47 #include "core/layout/compositing/CompositingLayerAssigner.h" 47 #include "core/layout/compositing/CompositingLayerAssigner.h"
48 #include "core/layout/compositing/CompositingRequirementsUpdater.h" 48 #include "core/layout/compositing/CompositingRequirementsUpdater.h"
49 #include "core/layout/compositing/GraphicsLayerTreeBuilder.h" 49 #include "core/layout/compositing/GraphicsLayerTreeBuilder.h"
50 #include "core/layout/compositing/GraphicsLayerUpdater.h" 50 #include "core/layout/compositing/GraphicsLayerUpdater.h"
51 #include "core/loader/FrameLoaderClient.h" 51 #include "core/loader/FrameLoaderClient.h"
52 #include "core/page/ChromeClient.h" 52 #include "core/page/ChromeClient.h"
53 #include "core/page/Page.h" 53 #include "core/page/Page.h"
54 #include "core/page/scrolling/RootScrollerController.h"
55 #include "core/page/scrolling/ScrollingCoordinator.h" 54 #include "core/page/scrolling/ScrollingCoordinator.h"
55 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
56 #include "core/paint/FramePainter.h" 56 #include "core/paint/FramePainter.h"
57 #include "core/paint/ObjectPaintInvalidator.h" 57 #include "core/paint/ObjectPaintInvalidator.h"
58 #include "core/paint/TransformRecorder.h" 58 #include "core/paint/TransformRecorder.h"
59 #include "platform/Histogram.h" 59 #include "platform/Histogram.h"
60 #include "platform/JSONValues.h" 60 #include "platform/JSONValues.h"
61 #include "platform/RuntimeEnabledFeatures.h" 61 #include "platform/RuntimeEnabledFeatures.h"
62 #include "platform/ScriptForbiddenScope.h" 62 #include "platform/ScriptForbiddenScope.h"
63 #include "platform/TraceEvent.h" 63 #include "platform/TraceEvent.h"
64 #include "platform/geometry/FloatRect.h" 64 #include "platform/geometry/FloatRect.h"
65 #include "platform/graphics/CompositorMutableProperties.h" 65 #include "platform/graphics/CompositorMutableProperties.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); 246 lifecycle().advanceTo(DocumentLifecycle::CompositingClean);
247 247
248 DocumentAnimations::updateCompositorAnimations(m_layoutView.document()); 248 DocumentAnimations::updateCompositorAnimations(m_layoutView.document());
249 249
250 m_layoutView.frameView()->getScrollableArea()->updateCompositorScrollAnimati ons(); 250 m_layoutView.frameView()->getScrollableArea()->updateCompositorScrollAnimati ons();
251 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = m_layoutV iew.frameView()->animatingScrollableAreas()) { 251 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = m_layoutV iew.frameView()->animatingScrollableAreas()) {
252 for (ScrollableArea* scrollableArea : *animatingScrollableAreas) 252 for (ScrollableArea* scrollableArea : *animatingScrollableAreas)
253 scrollableArea->updateCompositorScrollAnimations(); 253 scrollableArea->updateCompositorScrollAnimations();
254 } 254 }
255 255
256 m_layoutView.document().rootScrollerController()->didUpdateCompositing();
257 #if ENABLE(ASSERT) 256 #if ENABLE(ASSERT)
258 ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean); 257 ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean);
259 assertNoUnresolvedDirtyBits(); 258 assertNoUnresolvedDirtyBits();
260 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c hild; child = child->tree().nextSibling()) { 259 for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); c hild; child = child->tree().nextSibling()) {
261 if (!child->isLocalFrame()) 260 if (!child->isLocalFrame())
262 continue; 261 continue;
263 LocalFrame* localFrame = toLocalFrame(child); 262 LocalFrame* localFrame = toLocalFrame(child);
264 if (localFrame->shouldThrottleRendering() || localFrame->contentLayoutIt em().isNull()) 263 if (localFrame->shouldThrottleRendering() || localFrame->contentLayoutIt em().isNull())
265 continue; 264 continue;
266 localFrame->contentLayoutItem().compositor()->assertNoUnresolvedDirtyBit s(); 265 localFrame->contentLayoutItem().compositor()->assertNoUnresolvedDirtyBit s();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 if (m_layoutView.frame()->isMainFrame()) 463 if (m_layoutView.frame()->isMainFrame())
465 InspectorInstrumentation::layerTreeDidChange(m_layoutView.frame()); 464 InspectorInstrumentation::layerTreeDidChange(m_layoutView.frame());
466 } 465 }
467 466
468 void PaintLayerCompositor::setClippingOnRootScrollerAncestors() 467 void PaintLayerCompositor::setClippingOnRootScrollerAncestors()
469 { 468 {
470 bool shouldClip = !rootLayer()->hasRootScrollerAsDescendant(); 469 bool shouldClip = !rootLayer()->hasRootScrollerAsDescendant();
471 if (m_rootContentLayer) 470 if (m_rootContentLayer)
472 m_rootContentLayer->setMasksToBounds(shouldClip); 471 m_rootContentLayer->setMasksToBounds(shouldClip);
473 472
474 RootScrollerController* topRootScrollerController = 473 TopDocumentRootScrollerController& globalRootScrollerController =
tdresser 2016/08/30 15:05:30 const?
bokan 2016/08/30 16:13:39 Done.
475 m_layoutView.document().topDocument().rootScrollerController(); 474 m_layoutView.document().frameHost()->globalRootScrollerController();
476 bool frameIsRootScroller = 475 bool frameIsRootScroller =
477 topRootScrollerController->rootScrollerLayer() == scrollLayer(); 476 globalRootScrollerController.rootScrollerLayer() == scrollLayer();
478 477
479 // We normally clip iframes' (but not the root frame) overflow controls 478 // We normally clip iframes' (but not the root frame) overflow controls
480 // host and container layers but if the root scroller is the iframe itself 479 // host and container layers but if the root scroller is the iframe itself
481 // we want it to behave like the root frame. 480 // we want it to behave like the root frame.
482 shouldClip &= !frameIsRootScroller && !m_layoutView.frame()->isLocalRoot(); 481 shouldClip &= !frameIsRootScroller && !m_layoutView.frame()->isLocalRoot();
483 482
484 if (m_containerLayer) 483 if (m_containerLayer)
485 m_containerLayer->setMasksToBounds(shouldClip); 484 m_containerLayer->setMasksToBounds(shouldClip);
486 if (m_overflowControlsHostLayer) 485 if (m_overflowControlsHostLayer)
487 m_overflowControlsHostLayer->setMasksToBounds(shouldClip); 486 m_overflowControlsHostLayer->setMasksToBounds(shouldClip);
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 } else if (graphicsLayer == m_scrollLayer.get()) { 1266 } else if (graphicsLayer == m_scrollLayer.get()) {
1268 name = "Frame Scrolling Layer"; 1267 name = "Frame Scrolling Layer";
1269 } else { 1268 } else {
1270 ASSERT_NOT_REACHED(); 1269 ASSERT_NOT_REACHED();
1271 } 1270 }
1272 1271
1273 return name; 1272 return name;
1274 } 1273 }
1275 1274
1276 } // namespace blink 1275 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698