OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layers/texture_layer_impl.h" | 5 #include "cc/layers/texture_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 own_mailbox_ = true; | 50 own_mailbox_ = true; |
51 valid_texture_copy_ = false; | 51 valid_texture_copy_ = false; |
52 SetNeedsPushProperties(); | 52 SetNeedsPushProperties(); |
53 } | 53 } |
54 | 54 |
55 std::unique_ptr<LayerImpl> TextureLayerImpl::CreateLayerImpl( | 55 std::unique_ptr<LayerImpl> TextureLayerImpl::CreateLayerImpl( |
56 LayerTreeImpl* tree_impl) { | 56 LayerTreeImpl* tree_impl) { |
57 return TextureLayerImpl::Create(tree_impl, id()); | 57 return TextureLayerImpl::Create(tree_impl, id()); |
58 } | 58 } |
59 | 59 |
| 60 bool TextureLayerImpl::IsSnapped() { |
| 61 return true; |
| 62 } |
| 63 |
60 void TextureLayerImpl::PushPropertiesTo(LayerImpl* layer) { | 64 void TextureLayerImpl::PushPropertiesTo(LayerImpl* layer) { |
61 LayerImpl::PushPropertiesTo(layer); | 65 LayerImpl::PushPropertiesTo(layer); |
62 | 66 |
63 TextureLayerImpl* texture_layer = static_cast<TextureLayerImpl*>(layer); | 67 TextureLayerImpl* texture_layer = static_cast<TextureLayerImpl*>(layer); |
64 texture_layer->SetFlipped(flipped_); | 68 texture_layer->SetFlipped(flipped_); |
65 texture_layer->SetUVTopLeft(uv_top_left_); | 69 texture_layer->SetUVTopLeft(uv_top_left_); |
66 texture_layer->SetUVBottomRight(uv_bottom_right_); | 70 texture_layer->SetUVBottomRight(uv_bottom_right_); |
67 texture_layer->SetVertexOpacity(vertex_opacity_); | 71 texture_layer->SetVertexOpacity(vertex_opacity_); |
68 texture_layer->SetPremultipliedAlpha(premultiplied_alpha_); | 72 texture_layer->SetPremultipliedAlpha(premultiplied_alpha_); |
69 texture_layer->SetBlendBackgroundColor(blend_background_color_); | 73 texture_layer->SetBlendBackgroundColor(blend_background_color_); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } else if (external_texture_resource_) { | 263 } else if (external_texture_resource_) { |
260 DCHECK(!own_mailbox_); | 264 DCHECK(!own_mailbox_); |
261 ResourceProvider* resource_provider = | 265 ResourceProvider* resource_provider = |
262 layer_tree_impl()->resource_provider(); | 266 layer_tree_impl()->resource_provider(); |
263 resource_provider->DeleteResource(external_texture_resource_); | 267 resource_provider->DeleteResource(external_texture_resource_); |
264 external_texture_resource_ = 0; | 268 external_texture_resource_ = 0; |
265 } | 269 } |
266 } | 270 } |
267 | 271 |
268 } // namespace cc | 272 } // namespace cc |
OLD | NEW |