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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollState.cpp

Issue 2890953002: [SPv1] Always set a CompositorElementId on main graphics layers; use PaintLayer id. (Closed)
Patch Set: none Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/scrolling/ScrollState.h" 5 #include "core/page/scrolling/ScrollState.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/DOMNodeIds.h" 8 #include "core/dom/DOMNodeIds.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
11 #include "core/layout/LayoutObject.h"
11 #include "platform/graphics/CompositorElementId.h" 12 #include "platform/graphics/CompositorElementId.h"
12 #include "platform/wtf/PtrUtil.h" 13 #include "platform/wtf/PtrUtil.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 namespace { 17 namespace {
17 Element* ElementForId(int element_id) { 18 Element* ElementForId(int element_id) {
18 Node* node = DOMNodeIds::NodeForId(element_id); 19 Node* node = DOMNodeIds::NodeForId(element_id);
19 DCHECK(node); 20 DCHECK(node);
20 if (!node) 21 if (!node)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 if (data_->current_native_scrolling_element() == CompositorElementId()) { 97 if (data_->current_native_scrolling_element() == CompositorElementId()) {
97 element_.Clear(); 98 element_.Clear();
98 return nullptr; 99 return nullptr;
99 } 100 }
100 return element_; 101 return element_;
101 } 102 }
102 103
103 void ScrollState::SetCurrentNativeScrollingElement(Element* element) { 104 void ScrollState::SetCurrentNativeScrollingElement(Element* element) {
104 element_ = element; 105 element_ = element;
105 data_->set_current_native_scrolling_element(CompositorElementIdFromDOMNodeId( 106 data_->set_current_native_scrolling_element(CompositorElementIdFromDOMNodeId(
106 DOMNodeIds::IdForNode(element), CompositorElementIdNamespace::kScroll)); 107 DOMNodeIds::IdForNode(element),
108 CompositorElementIdNamespace::kScrollState));
107 } 109 }
108 110
109 } // namespace blink 111 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698