OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/scrollbar_animation_controller.h" | 10 #include "cc/animation/scrollbar_animation_controller.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // Because of the way scroll delta is calculated with a delegate, this will | 377 // Because of the way scroll delta is calculated with a delegate, this will |
378 // leave the total scroll offset unchanged on this layer regardless of | 378 // leave the total scroll offset unchanged on this layer regardless of |
379 // whether a delegate is being used. | 379 // whether a delegate is being used. |
380 scroll_offset_ += sent_scroll_delta_; | 380 scroll_offset_ += sent_scroll_delta_; |
381 scroll_delta_ -= sent_scroll_delta_; | 381 scroll_delta_ -= sent_scroll_delta_; |
382 sent_scroll_delta_ = gfx::Vector2d(); | 382 sent_scroll_delta_ = gfx::Vector2d(); |
383 } | 383 } |
384 | 384 |
385 InputHandler::ScrollStatus LayerImpl::TryScroll( | 385 InputHandler::ScrollStatus LayerImpl::TryScroll( |
386 gfx::PointF screen_space_point, | 386 gfx::PointF screen_space_point, |
387 InputHandler::ScrollInputType type) const { | 387 InputHandler::ScrollInputType type, |
388 | 388 bool main_frame_is_scrollable) const { |
389 if (should_scroll_on_main_thread()) { | 389 // The reasons forcing use to scroll on the main thread here are applicable |
| 390 // only for main frame scrolling. If we cannot scroll the main frame, then |
| 391 // we can disregard these reasons. |
| 392 if (should_scroll_on_main_thread() && main_frame_is_scrollable) { |
390 TRACE_EVENT_INSTANT0("cc,impl-scroll", | 393 TRACE_EVENT_INSTANT0("cc,impl-scroll", |
391 "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread", | 394 "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread", |
392 TRACE_EVENT_SCOPE_THREAD); | 395 TRACE_EVENT_SCOPE_THREAD); |
393 return InputHandler::ScrollOnMainThread; | 396 return InputHandler::ScrollOnMainThread; |
394 } | 397 } |
395 | 398 |
396 if (!screen_space_transform().IsInvertible()) { | 399 if (!screen_space_transform().IsInvertible()) { |
397 TRACE_EVENT_INSTANT0("cc,impl-scroll", | 400 TRACE_EVENT_INSTANT0("cc,impl-scroll", |
398 "LayerImpl::TryScroll: Ignored NonInvertibleTransform", | 401 "LayerImpl::TryScroll: Ignored NonInvertibleTransform", |
399 TRACE_EVENT_SCOPE_THREAD); | 402 TRACE_EVENT_SCOPE_THREAD); |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 | 1299 |
1297 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1300 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
1298 | 1301 |
1299 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1302 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1300 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1303 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1301 AsValueInto(state.get()); | 1304 AsValueInto(state.get()); |
1302 return state.PassAs<base::Value>(); | 1305 return state.PassAs<base::Value>(); |
1303 } | 1306 } |
1304 | 1307 |
1305 } // namespace cc | 1308 } // namespace cc |
OLD | NEW |