OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_H_ | 5 #ifndef CC_LAYERS_TEXTURE_LAYER_H_ |
6 #define CC_LAYERS_TEXTURE_LAYER_H_ | 6 #define CC_LAYERS_TEXTURE_LAYER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 static scoped_refptr<TextureLayer> CreateForMailbox( | 88 static scoped_refptr<TextureLayer> CreateForMailbox( |
89 TextureLayerClient* client); | 89 TextureLayerClient* client); |
90 | 90 |
91 // Resets the client, which also resets the texture. | 91 // Resets the client, which also resets the texture. |
92 void ClearClient(); | 92 void ClearClient(); |
93 | 93 |
94 // Resets the texture. | 94 // Resets the texture. |
95 void ClearTexture(); | 95 void ClearTexture(); |
96 | 96 |
97 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 97 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
98 OVERRIDE; | 98 override; |
99 | 99 |
100 // Sets whether this texture should be Y-flipped at draw time. Defaults to | 100 // Sets whether this texture should be Y-flipped at draw time. Defaults to |
101 // true. | 101 // true. |
102 void SetFlipped(bool flipped); | 102 void SetFlipped(bool flipped); |
103 | 103 |
104 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). | 104 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). |
105 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); | 105 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); |
106 | 106 |
107 // Sets an opacity value per vertex. It will be multiplied by the layer | 107 // Sets an opacity value per vertex. It will be multiplied by the layer |
108 // opacity value. | 108 // opacity value. |
(...skipping 18 matching lines...) Expand all Loading... |
127 // Code path for plugins which supply their own mailbox. | 127 // Code path for plugins which supply their own mailbox. |
128 void SetTextureMailbox(const TextureMailbox& mailbox, | 128 void SetTextureMailbox(const TextureMailbox& mailbox, |
129 scoped_ptr<SingleReleaseCallback> release_callback); | 129 scoped_ptr<SingleReleaseCallback> release_callback); |
130 | 130 |
131 // Use this for special cases where the same texture is used to back the | 131 // Use this for special cases where the same texture is used to back the |
132 // TextureLayer across all frames. | 132 // TextureLayer across all frames. |
133 // WARNING: DON'T ACTUALLY USE THIS WHAT YOU ARE DOING IS WRONG. | 133 // WARNING: DON'T ACTUALLY USE THIS WHAT YOU ARE DOING IS WRONG. |
134 // TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204 | 134 // TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204 |
135 void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox); | 135 void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox); |
136 | 136 |
137 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; | 137 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override; |
138 | 138 |
139 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; | 139 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; |
140 virtual bool Update(ResourceUpdateQueue* queue, | 140 virtual bool Update(ResourceUpdateQueue* queue, |
141 const OcclusionTracker<Layer>* occlusion) OVERRIDE; | 141 const OcclusionTracker<Layer>* occlusion) override; |
142 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 142 virtual void PushPropertiesTo(LayerImpl* layer) override; |
143 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE; | 143 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; |
144 | 144 |
145 protected: | 145 protected: |
146 explicit TextureLayer(TextureLayerClient* client); | 146 explicit TextureLayer(TextureLayerClient* client); |
147 virtual ~TextureLayer(); | 147 virtual ~TextureLayer(); |
148 virtual bool HasDrawableContent() const OVERRIDE; | 148 virtual bool HasDrawableContent() const override; |
149 | 149 |
150 private: | 150 private: |
151 void SetTextureMailboxInternal( | 151 void SetTextureMailboxInternal( |
152 const TextureMailbox& mailbox, | 152 const TextureMailbox& mailbox, |
153 scoped_ptr<SingleReleaseCallback> release_callback, | 153 scoped_ptr<SingleReleaseCallback> release_callback, |
154 bool requires_commit, | 154 bool requires_commit, |
155 bool allow_mailbox_reuse); | 155 bool allow_mailbox_reuse); |
156 | 156 |
157 TextureLayerClient* client_; | 157 TextureLayerClient* client_; |
158 | 158 |
159 bool flipped_; | 159 bool flipped_; |
160 gfx::PointF uv_top_left_; | 160 gfx::PointF uv_top_left_; |
161 gfx::PointF uv_bottom_right_; | 161 gfx::PointF uv_bottom_right_; |
162 // [bottom left, top left, top right, bottom right] | 162 // [bottom left, top left, top right, bottom right] |
163 float vertex_opacity_[4]; | 163 float vertex_opacity_[4]; |
164 bool premultiplied_alpha_; | 164 bool premultiplied_alpha_; |
165 bool blend_background_color_; | 165 bool blend_background_color_; |
166 bool rate_limit_context_; | 166 bool rate_limit_context_; |
167 | 167 |
168 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; | 168 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; |
169 bool needs_set_mailbox_; | 169 bool needs_set_mailbox_; |
170 | 170 |
171 DISALLOW_COPY_AND_ASSIGN(TextureLayer); | 171 DISALLOW_COPY_AND_ASSIGN(TextureLayer); |
172 }; | 172 }; |
173 | 173 |
174 } // namespace cc | 174 } // namespace cc |
175 #endif // CC_LAYERS_TEXTURE_LAYER_H_ | 175 #endif // CC_LAYERS_TEXTURE_LAYER_H_ |
OLD | NEW |