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 #ifndef CC_LAYERS_TEXTURE_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_TEXTURE_LAYER_IMPL_H_ |
6 #define CC_LAYERS_TEXTURE_LAYER_IMPL_H_ | 6 #define CC_LAYERS_TEXTURE_LAYER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 AppendQuadsData* append_quads_data) OVERRIDE; | 32 AppendQuadsData* append_quads_data) OVERRIDE; |
33 virtual void DidDraw(ResourceProvider* resource_provider) OVERRIDE; | 33 virtual void DidDraw(ResourceProvider* resource_provider) OVERRIDE; |
34 | 34 |
35 virtual void DidLoseOutputSurface() OVERRIDE; | 35 virtual void DidLoseOutputSurface() OVERRIDE; |
36 | 36 |
37 unsigned texture_id() const { return texture_id_; } | 37 unsigned texture_id() const { return texture_id_; } |
38 void set_texture_id(unsigned id) { texture_id_ = id; } | 38 void set_texture_id(unsigned id) { texture_id_ = id; } |
39 void set_premultiplied_alpha(bool premultiplied_alpha) { | 39 void set_premultiplied_alpha(bool premultiplied_alpha) { |
40 premultiplied_alpha_ = premultiplied_alpha; | 40 premultiplied_alpha_ = premultiplied_alpha; |
41 } | 41 } |
| 42 void set_blend_background_color(bool blend) { |
| 43 blend_background_color_ = blend; |
| 44 } |
42 void set_flipped(bool flipped) { flipped_ = flipped; } | 45 void set_flipped(bool flipped) { flipped_ = flipped; } |
43 void set_uv_top_left(gfx::PointF top_left) { uv_top_left_ = top_left; } | 46 void set_uv_top_left(gfx::PointF top_left) { uv_top_left_ = top_left; } |
44 void set_uv_bottom_right(gfx::PointF bottom_right) { | 47 void set_uv_bottom_right(gfx::PointF bottom_right) { |
45 uv_bottom_right_ = bottom_right; | 48 uv_bottom_right_ = bottom_right; |
46 } | 49 } |
47 | 50 |
48 // 1--2 | 51 // 1--2 |
49 // | | | 52 // | | |
50 // 0--3 | 53 // 0--3 |
51 void set_vertex_opacity(const float vertex_opacity[4]) { | 54 void set_vertex_opacity(const float vertex_opacity[4]) { |
52 vertex_opacity_[0] = vertex_opacity[0]; | 55 vertex_opacity_[0] = vertex_opacity[0]; |
53 vertex_opacity_[1] = vertex_opacity[1]; | 56 vertex_opacity_[1] = vertex_opacity[1]; |
54 vertex_opacity_[2] = vertex_opacity[2]; | 57 vertex_opacity_[2] = vertex_opacity[2]; |
55 vertex_opacity_[3] = vertex_opacity[3]; | 58 vertex_opacity_[3] = vertex_opacity[3]; |
56 } | 59 } |
57 | 60 |
58 virtual bool CanClipSelf() const OVERRIDE; | 61 virtual bool CanClipSelf() const OVERRIDE; |
59 | 62 |
60 void SetTextureMailbox(const TextureMailbox& mailbox); | 63 void SetTextureMailbox(const TextureMailbox& mailbox); |
61 | 64 |
62 private: | 65 private: |
63 TextureLayerImpl(LayerTreeImpl* tree_impl, int id, bool uses_mailbox); | 66 TextureLayerImpl(LayerTreeImpl* tree_impl, int id, bool uses_mailbox); |
64 | 67 |
65 virtual const char* LayerTypeAsString() const OVERRIDE; | 68 virtual const char* LayerTypeAsString() const OVERRIDE; |
66 void FreeTextureMailbox(); | 69 void FreeTextureMailbox(); |
67 | 70 |
68 unsigned texture_id_; | 71 unsigned texture_id_; |
69 ResourceProvider::ResourceId external_texture_resource_; | 72 ResourceProvider::ResourceId external_texture_resource_; |
70 bool premultiplied_alpha_; | 73 bool premultiplied_alpha_; |
| 74 bool blend_background_color_; |
71 bool flipped_; | 75 bool flipped_; |
72 gfx::PointF uv_top_left_; | 76 gfx::PointF uv_top_left_; |
73 gfx::PointF uv_bottom_right_; | 77 gfx::PointF uv_bottom_right_; |
74 float vertex_opacity_[4]; | 78 float vertex_opacity_[4]; |
75 | 79 |
76 TextureMailbox texture_mailbox_; | 80 TextureMailbox texture_mailbox_; |
77 bool uses_mailbox_; | 81 bool uses_mailbox_; |
78 bool own_mailbox_; | 82 bool own_mailbox_; |
79 | 83 |
80 DISALLOW_COPY_AND_ASSIGN(TextureLayerImpl); | 84 DISALLOW_COPY_AND_ASSIGN(TextureLayerImpl); |
81 }; | 85 }; |
82 | 86 |
83 } // namespace cc | 87 } // namespace cc |
84 | 88 |
85 #endif // CC_LAYERS_TEXTURE_LAYER_IMPL_H_ | 89 #endif // CC_LAYERS_TEXTURE_LAYER_IMPL_H_ |
OLD | NEW |