OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blimp/layer_tree_host_remote.h" | 5 #include "cc/blimp/layer_tree_host_remote.h" |
6 | 6 |
7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/blimp/compositor_proto_state.h" | 10 #include "cc/blimp/compositor_proto_state.h" |
11 #include "cc/blimp/engine_picture_cache.h" | 11 #include "cc/blimp/engine_picture_cache.h" |
12 #include "cc/blimp/picture_data_conversions.h" | 12 #include "cc/blimp/picture_data_conversions.h" |
13 #include "cc/blimp/remote_compositor_bridge.h" | 13 #include "cc/blimp/remote_compositor_bridge.h" |
14 #include "cc/output/begin_frame_args.h" | |
15 #include "cc/output/compositor_frame_sink.h" | 14 #include "cc/output/compositor_frame_sink.h" |
16 #include "cc/proto/compositor_message.pb.h" | 15 #include "cc/proto/compositor_message.pb.h" |
17 #include "cc/proto/gfx_conversions.h" | 16 #include "cc/proto/gfx_conversions.h" |
18 #include "cc/proto/layer_tree_host.pb.h" | 17 #include "cc/proto/layer_tree_host.pb.h" |
19 #include "cc/trees/layer_tree.h" | 18 #include "cc/trees/layer_tree.h" |
20 #include "cc/trees/layer_tree_host_client.h" | 19 #include "cc/trees/layer_tree_host_client.h" |
21 #include "cc/trees/layer_tree_host_common.h" | 20 #include "cc/trees/layer_tree_host_common.h" |
22 #include "cc/trees/mutator_host.h" | 21 #include "cc/trees/mutator_host.h" |
23 #include "cc/trees/task_runner_provider.h" | 22 #include "cc/trees/task_runner_provider.h" |
24 #include "ui/gfx/geometry/scroll_offset.h" | 23 #include "ui/gfx/geometry/scroll_offset.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // Start the main frame. It should go till the requested pipeline stage. | 363 // Start the main frame. It should go till the requested pipeline stage. |
365 max_pipeline_stage_for_current_frame_ = | 364 max_pipeline_stage_for_current_frame_ = |
366 requested_pipeline_stage_for_next_frame_; | 365 requested_pipeline_stage_for_next_frame_; |
367 requested_pipeline_stage_for_next_frame_ = FramePipelineStage::NONE; | 366 requested_pipeline_stage_for_next_frame_ = FramePipelineStage::NONE; |
368 | 367 |
369 client_->WillBeginMainFrame(); | 368 client_->WillBeginMainFrame(); |
370 | 369 |
371 current_pipeline_stage_ = FramePipelineStage::ANIMATE; | 370 current_pipeline_stage_ = FramePipelineStage::ANIMATE; |
372 base::TimeTicks now = base::TimeTicks::Now(); | 371 base::TimeTicks now = base::TimeTicks::Now(); |
373 client_->BeginMainFrame(BeginFrameArgs::Create( | 372 client_->BeginMainFrame(BeginFrameArgs::Create( |
374 BEGINFRAME_FROM_HERE, now, now + kDefaultFrameInterval, | 373 BEGINFRAME_FROM_HERE, |
| 374 static_cast<uint64_t>(reinterpret_cast<std::uintptr_t>(this)), |
| 375 begin_frame_number_++, now, now + kDefaultFrameInterval, |
375 kDefaultFrameInterval, BeginFrameArgs::NORMAL)); | 376 kDefaultFrameInterval, BeginFrameArgs::NORMAL)); |
376 // We don't run any animations on the layer because threaded animations are | 377 // We don't run any animations on the layer because threaded animations are |
377 // disabled. | 378 // disabled. |
378 // TODO(khushalsagar): Revisit this when adding support for animations. | 379 // TODO(khushalsagar): Revisit this when adding support for animations. |
379 client_->UpdateLayerTreeHost(); | 380 client_->UpdateLayerTreeHost(); |
380 | 381 |
381 current_pipeline_stage_ = FramePipelineStage::UPDATE_LAYERS; | 382 current_pipeline_stage_ = FramePipelineStage::UPDATE_LAYERS; |
382 LayerList layer_list; | 383 LayerList layer_list; |
383 if (max_pipeline_stage_for_current_frame_ >= | 384 if (max_pipeline_stage_for_current_frame_ >= |
384 FramePipelineStage::UPDATE_LAYERS) { | 385 FramePipelineStage::UPDATE_LAYERS) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 layer->ToLayerPropertiesProto(layer_properties); | 527 layer->ToLayerPropertiesProto(layer_properties); |
527 } | 528 } |
528 | 529 |
529 std::vector<PictureData> pictures = | 530 std::vector<PictureData> pictures = |
530 engine_picture_cache_->CalculateCacheUpdateAndFlush(); | 531 engine_picture_cache_->CalculateCacheUpdateAndFlush(); |
531 proto::PictureDataVectorToSkPicturesProto( | 532 proto::PictureDataVectorToSkPicturesProto( |
532 pictures, layer_tree_host_proto->mutable_pictures()); | 533 pictures, layer_tree_host_proto->mutable_pictures()); |
533 } | 534 } |
534 | 535 |
535 } // namespace cc | 536 } // namespace cc |
OLD | NEW |