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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2342103002: Refactor the way PaintArtifactCompositor is attached and used. (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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 #include "platform/ScriptForbiddenScope.h" 99 #include "platform/ScriptForbiddenScope.h"
100 #include "platform/TraceEvent.h" 100 #include "platform/TraceEvent.h"
101 #include "platform/TracedValue.h" 101 #include "platform/TracedValue.h"
102 #include "platform/fonts/FontCache.h" 102 #include "platform/fonts/FontCache.h"
103 #include "platform/geometry/DoubleRect.h" 103 #include "platform/geometry/DoubleRect.h"
104 #include "platform/geometry/FloatRect.h" 104 #include "platform/geometry/FloatRect.h"
105 #include "platform/geometry/LayoutRect.h" 105 #include "platform/geometry/LayoutRect.h"
106 #include "platform/graphics/GraphicsContext.h" 106 #include "platform/graphics/GraphicsContext.h"
107 #include "platform/graphics/GraphicsLayer.h" 107 #include "platform/graphics/GraphicsLayer.h"
108 #include "platform/graphics/GraphicsLayerDebugInfo.h" 108 #include "platform/graphics/GraphicsLayerDebugInfo.h"
109 #include "platform/graphics/compositing/PaintArtifactCompositor.h"
109 #include "platform/graphics/paint/CullRect.h" 110 #include "platform/graphics/paint/CullRect.h"
110 #include "platform/graphics/paint/PaintController.h" 111 #include "platform/graphics/paint/PaintController.h"
111 #include "platform/graphics/paint/ScopedPaintChunkProperties.h" 112 #include "platform/graphics/paint/ScopedPaintChunkProperties.h"
112 #include "platform/json/JSONValues.h" 113 #include "platform/json/JSONValues.h"
113 #include "platform/scheduler/CancellableTaskFactory.h" 114 #include "platform/scheduler/CancellableTaskFactory.h"
114 #include "platform/scroll/ScrollAnimatorBase.h" 115 #include "platform/scroll/ScrollAnimatorBase.h"
115 #include "platform/scroll/ScrollbarTheme.h" 116 #include "platform/scroll/ScrollbarTheme.h"
116 #include "platform/text/TextStream.h" 117 #include "platform/text/TextStream.h"
117 #include "public/platform/WebDisplayItemList.h" 118 #include "public/platform/WebDisplayItemList.h"
118 #include "public/platform/WebFrameScheduler.h" 119 #include "public/platform/WebFrameScheduler.h"
(...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 for (auto& child : graphicsLayer->children()) 2756 for (auto& child : graphicsLayer->children())
2756 synchronizedPaintRecursively(child); 2757 synchronizedPaintRecursively(child);
2757 } 2758 }
2758 2759
2759 void FrameView::pushPaintArtifactToCompositor() 2760 void FrameView::pushPaintArtifactToCompositor()
2760 { 2761 {
2761 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); 2762 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor");
2762 2763
2763 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2764 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2764 2765
2765 const PaintArtifact& paintArtifact = m_paintController->paintArtifact();
2766
2767 Page* page = frame().page(); 2766 Page* page = frame().page();
2768 if (!page) 2767 if (!page)
2769 return; 2768 return;
2770 page->chromeClient().didPaint(paintArtifact); 2769
2770 if (!m_paintArtifactCompositor) {
2771 m_paintArtifactCompositor = PaintArtifactCompositor::create();
2772 page->chromeClient().attachRootLayer(m_paintArtifactCompositor->getWebLa yer(), &frame());
jbroman 2016/09/15 21:31:04 For what it's worth, the concern here was that Web
2773 }
2774
2775 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime");
2776
2777 frameView.lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdateForSli mmingPaintV2);
2778 m_paintArtifactCompositor->update(m_paintController->paintArtifact());
2779 frameView.lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdateForSli mmingPaintV2Clean);
2771 } 2780 }
2772 2781
2773 void FrameView::updateStyleAndLayoutIfNeededRecursive() 2782 void FrameView::updateStyleAndLayoutIfNeededRecursive()
2774 { 2783 {
2775 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime"); 2784 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime");
2776 updateStyleAndLayoutIfNeededRecursiveInternal(); 2785 updateStyleAndLayoutIfNeededRecursiveInternal();
2777 } 2786 }
2778 2787
2779 void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() 2788 void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal()
2780 { 2789 {
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 } 4369 }
4361 4370
4362 bool FrameView::canThrottleRendering() const 4371 bool FrameView::canThrottleRendering() const
4363 { 4372 {
4364 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4373 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4365 return false; 4374 return false;
4366 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4375 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4367 } 4376 }
4368 4377
4369 } // namespace blink 4378 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698