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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Code path for plugins which supply their own texture ID. | 125 // Code path for plugins which supply their own texture ID. |
126 // DEPRECATED. DO NOT USE. | 126 // DEPRECATED. DO NOT USE. |
127 void SetTextureId(unsigned texture_id); | 127 void SetTextureId(unsigned texture_id); |
128 | 128 |
129 // Code path for plugins which supply their own mailbox. | 129 // Code path for plugins which supply their own mailbox. |
130 bool uses_mailbox() const { return uses_mailbox_; } | 130 bool uses_mailbox() const { return uses_mailbox_; } |
131 void SetTextureMailbox(const TextureMailbox& mailbox, | 131 void SetTextureMailbox(const TextureMailbox& mailbox, |
132 scoped_ptr<SingleReleaseCallback> release_callback); | 132 scoped_ptr<SingleReleaseCallback> release_callback); |
133 | 133 |
| 134 // Use this for special cases where the same texture is used to back the |
| 135 // TextureLayer across all frames. |
| 136 // WARNING: DON'T ACTUALLY USE THIS WHAT YOU ARE DOING IS WRONG. |
| 137 // TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204 |
| 138 void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox); |
| 139 |
134 void WillModifyTexture(); | 140 void WillModifyTexture(); |
135 | 141 |
136 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; | 142 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; |
137 | 143 |
138 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; | 144 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; |
139 virtual bool DrawsContent() const OVERRIDE; | 145 virtual bool DrawsContent() const OVERRIDE; |
140 virtual bool Update(ResourceUpdateQueue* queue, | 146 virtual bool Update(ResourceUpdateQueue* queue, |
141 const OcclusionTracker<Layer>* occlusion) OVERRIDE; | 147 const OcclusionTracker<Layer>* occlusion) OVERRIDE; |
142 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 148 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
143 virtual Region VisibleContentOpaqueRegion() const OVERRIDE; | 149 virtual Region VisibleContentOpaqueRegion() const OVERRIDE; |
144 | 150 |
145 protected: | 151 protected: |
146 TextureLayer(TextureLayerClient* client, bool uses_mailbox); | 152 TextureLayer(TextureLayerClient* client, bool uses_mailbox); |
147 virtual ~TextureLayer(); | 153 virtual ~TextureLayer(); |
148 | 154 |
149 private: | 155 private: |
150 void SetTextureMailboxInternal( | 156 void SetTextureMailboxInternal( |
151 const TextureMailbox& mailbox, | 157 const TextureMailbox& mailbox, |
152 scoped_ptr<SingleReleaseCallback> release_callback, | 158 scoped_ptr<SingleReleaseCallback> release_callback, |
153 bool requires_commit); | 159 bool requires_commit, |
| 160 bool allow_mailbox_reuse); |
154 | 161 |
155 TextureLayerClient* client_; | 162 TextureLayerClient* client_; |
156 bool uses_mailbox_; | 163 bool uses_mailbox_; |
157 | 164 |
158 bool flipped_; | 165 bool flipped_; |
159 gfx::PointF uv_top_left_; | 166 gfx::PointF uv_top_left_; |
160 gfx::PointF uv_bottom_right_; | 167 gfx::PointF uv_bottom_right_; |
161 // [bottom left, top left, top right, bottom right] | 168 // [bottom left, top left, top right, bottom right] |
162 float vertex_opacity_[4]; | 169 float vertex_opacity_[4]; |
163 bool premultiplied_alpha_; | 170 bool premultiplied_alpha_; |
164 bool blend_background_color_; | 171 bool blend_background_color_; |
165 bool rate_limit_context_; | 172 bool rate_limit_context_; |
166 bool content_committed_; | 173 bool content_committed_; |
167 | 174 |
168 unsigned texture_id_; | 175 unsigned texture_id_; |
169 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; | 176 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; |
170 bool needs_set_mailbox_; | 177 bool needs_set_mailbox_; |
171 | 178 |
172 DISALLOW_COPY_AND_ASSIGN(TextureLayer); | 179 DISALLOW_COPY_AND_ASSIGN(TextureLayer); |
173 }; | 180 }; |
174 | 181 |
175 } // namespace cc | 182 } // namespace cc |
176 #endif // CC_LAYERS_TEXTURE_LAYER_H_ | 183 #endif // CC_LAYERS_TEXTURE_LAYER_H_ |
OLD | NEW |