OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/test/fake_picture_layer.h" | 5 #include "cc/test/fake_picture_layer.h" |
6 | 6 |
7 #include "cc/proto/layer.pb.h" | |
8 #include "cc/test/fake_picture_layer_impl.h" | 7 #include "cc/test/fake_picture_layer_impl.h" |
9 | 8 |
10 namespace cc { | 9 namespace cc { |
11 | 10 |
12 FakePictureLayer::FakePictureLayer(ContentLayerClient* client) | 11 FakePictureLayer::FakePictureLayer(ContentLayerClient* client) |
13 : PictureLayer(client), | 12 : PictureLayer(client), |
14 update_count_(0), | 13 update_count_(0), |
15 always_update_resources_(false), | 14 always_update_resources_(false), |
16 force_unsuitable_for_gpu_rasterization_(false) { | 15 force_unsuitable_for_gpu_rasterization_(false) { |
17 SetBounds(gfx::Size(1, 1)); | 16 SetBounds(gfx::Size(1, 1)); |
(...skipping 24 matching lines...) Expand all Loading... |
42 update_count_++; | 41 update_count_++; |
43 return updated || always_update_resources_; | 42 return updated || always_update_resources_; |
44 } | 43 } |
45 | 44 |
46 bool FakePictureLayer::IsSuitableForGpuRasterization() const { | 45 bool FakePictureLayer::IsSuitableForGpuRasterization() const { |
47 if (force_unsuitable_for_gpu_rasterization_) | 46 if (force_unsuitable_for_gpu_rasterization_) |
48 return false; | 47 return false; |
49 return PictureLayer::IsSuitableForGpuRasterization(); | 48 return PictureLayer::IsSuitableForGpuRasterization(); |
50 } | 49 } |
51 | 50 |
52 void FakePictureLayer::SetTypeForProtoSerialization( | |
53 proto::LayerNode* proto) const { | |
54 proto->set_type(proto::LayerNode::FAKE_PICTURE_LAYER); | |
55 } | |
56 | |
57 } // namespace cc | 51 } // namespace cc |
OLD | NEW |