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

Side by Side Diff: cc/test/push_properties_counting_layer_impl.cc

Issue 2456093003: Enable more layer_tree_host_unittest for LayerTreeHostRemote. (Closed)
Patch Set: Minor polish on refactored test class. Created 4 years, 1 month 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/test/push_properties_counting_layer_impl.h ('k') | cc/test/remote_client_layer_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/test/push_properties_counting_layer_impl.h"
6
7 namespace cc {
8
9 // static
10 std::unique_ptr<PushPropertiesCountingLayerImpl>
11 PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) {
12 return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id));
13 }
14
15 PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl(
16 LayerTreeImpl* tree_impl,
17 int id)
18 : LayerImpl(tree_impl, id), push_properties_count_(0) {
19 SetBounds(gfx::Size(1, 1));
20 }
21
22 PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default;
23
24 void PushPropertiesCountingLayerImpl::PushPropertiesTo(LayerImpl* layer) {
25 LayerImpl::PushPropertiesTo(layer);
26 push_properties_count_++;
27 // Push state to the active tree because we can only access it from there.
28 static_cast<PushPropertiesCountingLayerImpl*>(layer)->push_properties_count_ =
29 push_properties_count_;
30 }
31
32 std::unique_ptr<LayerImpl> PushPropertiesCountingLayerImpl::CreateLayerImpl(
33 LayerTreeImpl* tree_impl) {
34 return PushPropertiesCountingLayerImpl::Create(tree_impl, LayerImpl::id());
35 }
36
37 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/push_properties_counting_layer_impl.h ('k') | cc/test/remote_client_layer_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698