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

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

Issue 908453003: Blink changes to record interest rects for http://w3c.github.io/frame-timing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update LayoutTests for new properties Created 5 years, 7 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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/frame/UseCounter.h » ('j') | 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) 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 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 if (view) { 2541 if (view) {
2542 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up dateLayerTree", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateLayerTreeEvent: :data(m_frame.get())); 2542 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Up dateLayerTree", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateLayerTreeEvent: :data(m_frame.get()));
2543 2543
2544 view->compositor()->updateIfNeededRecursive(); 2544 view->compositor()->updateIfNeededRecursive();
2545 2545
2546 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) 2546 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot())
2547 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); 2547 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
2548 2548
2549 updateCompositedSelectionIfNeeded(); 2549 updateCompositedSelectionIfNeeded();
2550 2550
2551 if (RuntimeEnabledFeatures::frameTimingSupportEnabled())
2552 updateFrameTimingRequestsIfNeeded();
2553
2551 scrollContentsIfNeededRecursive(); 2554 scrollContentsIfNeededRecursive();
2552 2555
2553 invalidateTreeIfNeededRecursive(); 2556 invalidateTreeIfNeededRecursive();
2554 2557
2555 ASSERT(!view->hasPendingSelection()); 2558 ASSERT(!view->hasPendingSelection());
2556 } 2559 }
2557 2560
2558 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); 2561 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
2559 } 2562 }
2560 2563
2564 void FrameView::updateFrameTimingRequestsIfNeeded()
2565 {
2566 GraphicsLayerFrameTimingRequests graphicsLayerTimingRequests;
2567 // TODO(mpb) use a 'dirty' bit to not call this every time.
2568 collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests);
2569
2570 for (const auto& iter : graphicsLayerTimingRequests) {
2571 const GraphicsLayer* graphicsLayer = iter.key;
2572 graphicsLayer->platformLayer()->setFrameTimingRequests(iter.value);
2573 }
2574 }
2575
2561 void FrameView::updateLayoutAndStyleIfNeededRecursive() 2576 void FrameView::updateLayoutAndStyleIfNeededRecursive()
2562 { 2577 {
2563 // We have to crawl our entire subtree looking for any FrameViews that need 2578 // We have to crawl our entire subtree looking for any FrameViews that need
2564 // layout and make sure they are up to date. 2579 // layout and make sure they are up to date.
2565 // Mac actually tests for intersection with the dirty region and tries not t o 2580 // Mac actually tests for intersection with the dirty region and tries not t o
2566 // update layout for frames that are outside the dirty region. Not only doe s this seem 2581 // update layout for frames that are outside the dirty region. Not only doe s this seem
2567 // pointless (since those frames will have set a zero timer to layout anyway ), but 2582 // pointless (since those frames will have set a zero timer to layout anyway ), but
2568 // it is also incorrect, since if two frames overlap, the first could be exc luded from the dirty 2583 // it is also incorrect, since if two frames overlap, the first could be exc luded from the dirty
2569 // region but then become included later by the second frame adding rects to the dirty region 2584 // region but then become included later by the second frame adding rects to the dirty region
2570 // when it lays out. 2585 // when it lays out.
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
4022 // LayoutTexts don't have their own style, they just use their parent's styl e, 4037 // LayoutTexts don't have their own style, they just use their parent's styl e,
4023 // so we don't want to include them. 4038 // so we don't want to include them.
4024 if (layoutObject.isText()) 4039 if (layoutObject.isText())
4025 return; 4040 return;
4026 4041
4027 layoutObject.addAnnotatedRegions(regions); 4042 layoutObject.addAnnotatedRegions(regions);
4028 for (LayoutObject* curr = layoutObject.slowFirstChild(); curr; curr = curr-> nextSibling()) 4043 for (LayoutObject* curr = layoutObject.slowFirstChild(); curr; curr = curr-> nextSibling())
4029 collectAnnotatedRegions(*curr, regions); 4044 collectAnnotatedRegions(*curr, regions);
4030 } 4045 }
4031 4046
4047 void FrameView::collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequ ests& graphicsLayerTimingRequests)
4048 {
4049 collectFrameTimingRequests(graphicsLayerTimingRequests);
4050
4051 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) {
4052 if (!child->isLocalFrame())
4053 continue;
4054
4055 toLocalFrame(child)->view()->collectFrameTimingRequestsRecursive(graphic sLayerTimingRequests);
4056 }
4057 }
4058
4059 void FrameView::collectFrameTimingRequests(GraphicsLayerFrameTimingRequests& gra phicsLayerTimingRequests)
4060 {
4061 if (!m_frame->isLocalFrame())
4062 return;
4063 Frame* frame = m_frame.get();
4064 LocalFrame* localFrame = toLocalFrame(frame);
4065 LayoutRect viewRect = localFrame->contentLayoutObject()->viewRect();
4066 const LayoutBoxModelObject* paintInvalidationContainer = localFrame->content LayoutObject()->containerForPaintInvalidation();
4067 const GraphicsLayer* graphicsLayer = paintInvalidationContainer->enclosingLa yer()->graphicsLayerBacking();
4068
4069 if (!graphicsLayer)
4070 return;
4071
4072 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
4073
4074 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
4075 }
4076
4032 } // namespace blink 4077 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698