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

Side by Side Diff: cc/blimp/layer_tree_host_remote.cc

Issue 2397843003: cc/blimp: Add (de)-serialization for PictureLayer and ScrollbarLayer. (Closed)
Patch Set: Addressed comments Created 4 years, 2 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 | « cc/blimp/layer_tree_host_remote.h ('k') | cc/blimp/layer_tree_host_remote_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.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"
12 #include "cc/blimp/picture_data_conversions.h"
11 #include "cc/blimp/remote_compositor_bridge.h" 13 #include "cc/blimp/remote_compositor_bridge.h"
12 #include "cc/output/begin_frame_args.h" 14 #include "cc/output/begin_frame_args.h"
13 #include "cc/output/compositor_frame_sink.h" 15 #include "cc/output/compositor_frame_sink.h"
14 #include "cc/proto/compositor_message.pb.h" 16 #include "cc/proto/compositor_message.pb.h"
15 #include "cc/proto/layer_tree_host.pb.h" 17 #include "cc/proto/layer_tree_host.pb.h"
16 #include "cc/trees/layer_tree.h" 18 #include "cc/trees/layer_tree.h"
17 #include "cc/trees/layer_tree_host_client.h" 19 #include "cc/trees/layer_tree_host_client.h"
18 #include "cc/trees/layer_tree_host_common.h" 20 #include "cc/trees/layer_tree_host_common.h"
19 #include "cc/trees/task_runner_provider.h" 21 #include "cc/trees/task_runner_provider.h"
20 22
(...skipping 18 matching lines...) Expand all
39 41
40 LayerTreeHostRemote::LayerTreeHostRemote(InitParams* params, 42 LayerTreeHostRemote::LayerTreeHostRemote(InitParams* params,
41 std::unique_ptr<LayerTree> layer_tree) 43 std::unique_ptr<LayerTree> layer_tree)
42 : id_(s_layer_tree_host_sequence_number.GetNext() + 1), 44 : id_(s_layer_tree_host_sequence_number.GetNext() + 1),
43 main_frame_requested_from_bridge_(false), 45 main_frame_requested_from_bridge_(false),
44 client_(params->client), 46 client_(params->client),
45 task_runner_provider_( 47 task_runner_provider_(
46 TaskRunnerProvider::Create(std::move(params->main_task_runner), 48 TaskRunnerProvider::Create(std::move(params->main_task_runner),
47 nullptr)), 49 nullptr)),
48 remote_compositor_bridge_(std::move(params->remote_compositor_bridge)), 50 remote_compositor_bridge_(std::move(params->remote_compositor_bridge)),
51 engine_picture_cache_(std::move(params->engine_picture_cache)),
49 settings_(*params->settings), 52 settings_(*params->settings),
50 layer_tree_(std::move(layer_tree)), 53 layer_tree_(std::move(layer_tree)),
51 weak_factory_(this) { 54 weak_factory_(this) {
52 DCHECK(task_runner_provider_->IsMainThread()); 55 DCHECK(task_runner_provider_->IsMainThread());
53 DCHECK(remote_compositor_bridge_); 56 DCHECK(remote_compositor_bridge_);
54 DCHECK(client_); 57 DCHECK(client_);
55 remote_compositor_bridge_->BindToClient(this); 58 remote_compositor_bridge_->BindToClient(this);
59 layer_tree_->set_engine_picture_cache(engine_picture_cache_.get());
56 } 60 }
57 61
58 LayerTreeHostRemote::~LayerTreeHostRemote() = default; 62 LayerTreeHostRemote::~LayerTreeHostRemote() = default;
59 63
60 int LayerTreeHostRemote::GetId() const { 64 int LayerTreeHostRemote::GetId() const {
61 return id_; 65 return id_;
62 } 66 }
63 67
64 int LayerTreeHostRemote::SourceFrameNumber() const { 68 int LayerTreeHostRemote::SourceFrameNumber() const {
65 return source_frame_number_; 69 return source_frame_number_;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // Serialize the LayerTree. 436 // Serialize the LayerTree.
433 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), 437 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(),
434 inputs_only); 438 inputs_only);
435 439
436 // Serialize the dirty layers. 440 // Serialize the dirty layers.
437 for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) 441 for (auto* layer : layer_tree_->LayersThatShouldPushProperties())
438 layer->ToLayerPropertiesProto( 442 layer->ToLayerPropertiesProto(
439 layer_tree_host_proto->mutable_layer_updates(), inputs_only); 443 layer_tree_host_proto->mutable_layer_updates(), inputs_only);
440 layer_tree_->LayersThatShouldPushProperties().clear(); 444 layer_tree_->LayersThatShouldPushProperties().clear();
441 445
442 // TODO(khushalsagar): Deal with picture caching. 446 std::vector<PictureData> pictures =
447 engine_picture_cache_->CalculateCacheUpdateAndFlush();
448 proto::PictureDataVectorToSkPicturesProto(
449 pictures, layer_tree_host_proto->mutable_pictures());
443 } 450 }
444 451
445 } // namespace cc 452 } // namespace cc
OLDNEW
« no previous file with comments | « cc/blimp/layer_tree_host_remote.h ('k') | cc/blimp/layer_tree_host_remote_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698