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

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

Issue 2380683006: SPv2: Add support for tracking raster paint invalidations in testing. (Closed)
Patch Set: none Created 4 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) 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 2799 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 return; 2810 return;
2811 2811
2812 if (!m_paintArtifactCompositor) { 2812 if (!m_paintArtifactCompositor) {
2813 m_paintArtifactCompositor = PaintArtifactCompositor::create(); 2813 m_paintArtifactCompositor = PaintArtifactCompositor::create();
2814 page->chromeClient().attachRootLayer( 2814 page->chromeClient().attachRootLayer(
2815 m_paintArtifactCompositor->getWebLayer(), &frame()); 2815 m_paintArtifactCompositor->getWebLayer(), &frame());
2816 } 2816 }
2817 2817
2818 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); 2818 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime");
2819 2819
2820 m_paintArtifactCompositor->update(m_paintController->paintArtifact()); 2820 m_paintArtifactCompositor->update(
2821 m_paintController->paintArtifact(),
2822 m_paintController->paintChunksRasterInvalidationTrackingMap());
2823 }
2824
2825 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON(
2826 LayerTreeFlags flags) {
2827 return frame()
2828 .localFrameRoot()
2829 ->view()
2830 ->m_paintArtifactCompositor->layersAsJSON(flags);
2821 } 2831 }
2822 2832
2823 void FrameView::updateStyleAndLayoutIfNeededRecursive() { 2833 void FrameView::updateStyleAndLayoutIfNeededRecursive() {
2824 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime"); 2834 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime");
2825 updateStyleAndLayoutIfNeededRecursiveInternal(); 2835 updateStyleAndLayoutIfNeededRecursiveInternal();
2826 } 2836 }
2827 2837
2828 void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() { 2838 void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() {
2829 if (shouldThrottleRendering() || !m_frame->document()->isActive()) 2839 if (shouldThrottleRendering() || !m_frame->document()->isActive())
2830 return; 2840 return;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3197 return; 3207 return;
3198 3208
3199 for (Frame* frame = m_frame->tree().top(); frame; 3209 for (Frame* frame = m_frame->tree().top(); frame;
3200 frame = frame->tree().traverseNext()) { 3210 frame = frame->tree().traverseNext()) {
3201 if (!frame->isLocalFrame()) 3211 if (!frame->isLocalFrame())
3202 continue; 3212 continue;
3203 if (LayoutViewItem layoutView = toLocalFrame(frame)->contentLayoutItem()) { 3213 if (LayoutViewItem layoutView = toLocalFrame(frame)->contentLayoutItem()) {
3204 layoutView.frameView()->m_trackedObjectPaintInvalidations = wrapUnique( 3214 layoutView.frameView()->m_trackedObjectPaintInvalidations = wrapUnique(
3205 trackPaintInvalidations ? new Vector<ObjectPaintInvalidation> 3215 trackPaintInvalidations ? new Vector<ObjectPaintInvalidation>
3206 : nullptr); 3216 : nullptr);
3207 layoutView.compositor()->setTracksPaintInvalidations( 3217 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
3208 trackPaintInvalidations); 3218 m_paintController->setTracksRasterInvalidations(
3219 trackPaintInvalidations);
3220 m_paintArtifactCompositor->setTracksRasterInvalidations(
3221 trackPaintInvalidations);
3222 } else {
3223 layoutView.compositor()->setTracksRasterInvalidations(
3224 trackPaintInvalidations);
3225 }
3209 } 3226 }
3210 } 3227 }
3211 3228
3212 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), 3229 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"),
3213 "FrameView::setTracksPaintInvalidations", 3230 "FrameView::setTracksPaintInvalidations",
3214 TRACE_EVENT_SCOPE_GLOBAL, "enabled", 3231 TRACE_EVENT_SCOPE_GLOBAL, "enabled",
3215 trackPaintInvalidations); 3232 trackPaintInvalidations);
3216 } 3233 }
3217 3234
3218 void FrameView::trackObjectPaintInvalidation(const DisplayItemClient& client, 3235 void FrameView::trackObjectPaintInvalidation(const DisplayItemClient& client,
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 } 4522 }
4506 4523
4507 bool FrameView::canThrottleRendering() const { 4524 bool FrameView::canThrottleRendering() const {
4508 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4525 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4509 return false; 4526 return false;
4510 return m_subtreeThrottled || 4527 return m_subtreeThrottled ||
4511 (m_hiddenForThrottling && m_crossOriginForThrottling); 4528 (m_hiddenForThrottling && m_crossOriginForThrottling);
4512 } 4529 }
4513 4530
4514 } // namespace blink 4531 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698