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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 #include <limits> | 11 #include <limits> |
12 #include <map> | 12 #include <map> |
13 #include <set> | 13 #include <set> |
14 #include <unordered_map> | 14 #include <unordered_map> |
15 #include <utility> | 15 #include <utility> |
16 | 16 |
17 #include "base/auto_reset.h" | 17 #include "base/auto_reset.h" |
18 #include "base/bind.h" | |
18 #include "base/containers/small_map.h" | 19 #include "base/containers/small_map.h" |
19 #include "base/json/json_writer.h" | 20 #include "base/json/json_writer.h" |
20 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
21 #include "base/numerics/safe_conversions.h" | 22 #include "base/numerics/safe_conversions.h" |
22 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
23 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
24 #include "base/trace_event/trace_event_argument.h" | 25 #include "base/trace_event/trace_event_argument.h" |
25 #include "cc/animation/animation_events.h" | 26 #include "cc/animation/animation_events.h" |
26 #include "cc/animation/animation_host.h" | 27 #include "cc/animation/animation_host.h" |
27 #include "cc/animation/animation_id_provider.h" | 28 #include "cc/animation/animation_id_provider.h" |
(...skipping 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3246 viewport()->PinchEnd(); | 3247 viewport()->PinchEnd(); |
3247 top_controls_manager_->PinchEnd(); | 3248 top_controls_manager_->PinchEnd(); |
3248 client_->SetNeedsCommitOnImplThread(); | 3249 client_->SetNeedsCommitOnImplThread(); |
3249 // When a pinch ends, we may be displaying content cached at incorrect scales, | 3250 // When a pinch ends, we may be displaying content cached at incorrect scales, |
3250 // so updating draw properties and drawing will ensure we are using the right | 3251 // so updating draw properties and drawing will ensure we are using the right |
3251 // scales that we want when we're not inside a pinch. | 3252 // scales that we want when we're not inside a pinch. |
3252 active_tree_->set_needs_update_draw_properties(); | 3253 active_tree_->set_needs_update_draw_properties(); |
3253 SetNeedsRedraw(); | 3254 SetNeedsRedraw(); |
3254 } | 3255 } |
3255 | 3256 |
3257 scoped_ptr<BeginFrameCallbackList> | |
3258 LayerTreeHostImpl::ProcessLayerTreeMutations() { | |
3259 // TODO(majidvp): This is where we turn |LayerTreeMutationsCallback| into | |
3260 // a list of closures. | |
3261 auto callbacks = make_scoped_ptr(new BeginFrameCallbackList()); | |
esprehn
2016/03/22 21:16:49
just return it? Why do we need the local?
majidvp
2016/03/23 22:24:53
Fixed.
| |
3262 return callbacks; | |
3263 } | |
3264 | |
3256 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, | 3265 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, |
3257 LayerImpl* layer_impl) { | 3266 LayerImpl* layer_impl) { |
3258 if (!layer_impl) | 3267 if (!layer_impl) |
3259 return; | 3268 return; |
3260 | 3269 |
3261 gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread(); | 3270 gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread(); |
3262 | 3271 |
3263 if (!scroll_delta.IsZero()) { | 3272 if (!scroll_delta.IsZero()) { |
3264 LayerTreeHostCommon::ScrollUpdateInfo scroll; | 3273 LayerTreeHostCommon::ScrollUpdateInfo scroll; |
3265 scroll.layer_id = layer_impl->id(); | 3274 scroll.layer_id = layer_impl->id(); |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3980 return task_runner_provider_->HasImplThread(); | 3989 return task_runner_provider_->HasImplThread(); |
3981 } | 3990 } |
3982 | 3991 |
3983 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3992 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3984 // In single threaded mode we skip the pending tree and commit directly to the | 3993 // In single threaded mode we skip the pending tree and commit directly to the |
3985 // active tree. | 3994 // active tree. |
3986 return !task_runner_provider_->HasImplThread(); | 3995 return !task_runner_provider_->HasImplThread(); |
3987 } | 3996 } |
3988 | 3997 |
3989 } // namespace cc | 3998 } // namespace cc |
OLD | NEW |