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

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

Issue 2456093003: Enable more layer_tree_host_unittest for LayerTreeHostRemote. (Closed)
Patch Set: Works on feedback. 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
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.h"
6
7 #include "cc/test/push_properties_counting_layer_impl.h"
8
9 namespace cc {
10
11 // static
12 scoped_refptr<PushPropertiesCountingLayer>
13 PushPropertiesCountingLayer::Create() {
14 return new PushPropertiesCountingLayer();
15 }
16
17 PushPropertiesCountingLayer::PushPropertiesCountingLayer()
18 : push_properties_count_(0), persist_needs_push_properties_(false) {
19 SetBounds(gfx::Size(1, 1));
20 }
21
22 PushPropertiesCountingLayer::~PushPropertiesCountingLayer() = default;
23
24 void PushPropertiesCountingLayer::PushPropertiesTo(LayerImpl* layer) {
25 Layer::PushPropertiesTo(layer);
26 AddPushPropertiesCount();
27 }
28
29 std::unique_ptr<LayerImpl> PushPropertiesCountingLayer::CreateLayerImpl(
30 LayerTreeImpl* tree_impl) {
31 return PushPropertiesCountingLayerImpl::Create(tree_impl, Layer::id());
32 }
33
34 void PushPropertiesCountingLayer::ToLayerPropertiesProto(
35 proto::LayerUpdate* layer_update,
36 bool inputs_only) {
37 Layer::ToLayerPropertiesProto(layer_update, inputs_only);
38 AddPushPropertiesCount();
39 }
40
41 void PushPropertiesCountingLayer::SetTypeForProtoSerialization(
42 proto::LayerNode* proto) const {
43 proto->set_type(proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER);
44 }
45
46 void PushPropertiesCountingLayer::MakePushProperties() {
47 SetContentsOpaque(!contents_opaque());
48 }
49
50 void PushPropertiesCountingLayer::SetDrawsContent(bool draws_content) {
51 SetIsDrawable(draws_content);
David Trainor- moved to gerrit 2016/11/02 17:00:04 This method feels unnecessary, but it looks like y
xingliu 2016/11/02 17:33:53 Done, sorry didn't notice this method.
52 }
53
54 void PushPropertiesCountingLayer::AddPushPropertiesCount() {
55 push_properties_count_++;
56 if (persist_needs_push_properties_) {
57 GetLayerTree()->AddLayerShouldPushProperties(this);
58 }
59 }
60
61 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698