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