| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 friend class MailboxManagerSync; | 60 friend class MailboxManagerSync; |
| 61 friend class MailboxManagerImpl; | 61 friend class MailboxManagerImpl; |
| 62 | 62 |
| 63 void SetMailboxManager(MailboxManager* mailbox_manager); | 63 void SetMailboxManager(MailboxManager* mailbox_manager); |
| 64 | 64 |
| 65 MailboxManager* mailbox_manager_; | 65 MailboxManager* mailbox_manager_; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // A ref-counted version of the TextureBase class that deletes the texture after |
| 69 // all references have been released. |
| 70 class TexturePassthrough final : public TextureBase, |
| 71 public base::RefCounted<TexturePassthrough> { |
| 72 public: |
| 73 explicit TexturePassthrough(GLuint service_id); |
| 74 |
| 75 // Notify the texture that the context is lost and it shouldn't delete the |
| 76 // native GL texture in the destructor |
| 77 void MarkContextLost(); |
| 78 |
| 79 protected: |
| 80 ~TexturePassthrough() override; |
| 81 |
| 82 private: |
| 83 friend class base::RefCounted<TexturePassthrough>; |
| 84 |
| 85 bool have_context_; |
| 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(TexturePassthrough); |
| 88 }; |
| 89 |
| 68 // Info about Textures currently in the system. | 90 // Info about Textures currently in the system. |
| 69 // This class wraps a real GL texture, keeping track of its meta-data. It is | 91 // This class wraps a real GL texture, keeping track of its meta-data. It is |
| 70 // jointly owned by possibly multiple TextureRef. | 92 // jointly owned by possibly multiple TextureRef. |
| 71 class GPU_EXPORT Texture final : public TextureBase { | 93 class GPU_EXPORT Texture final : public TextureBase { |
| 72 public: | 94 public: |
| 73 enum ImageState { | 95 enum ImageState { |
| 74 // If an image is associated with the texture and image state is UNBOUND, | 96 // If an image is associated with the texture and image state is UNBOUND, |
| 75 // then sampling out of the texture or using it as a target for drawing | 97 // then sampling out of the texture or using it as a target for drawing |
| 76 // will not read/write from/to the image. | 98 // will not read/write from/to the image. |
| 77 UNBOUND, | 99 UNBOUND, |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 private: | 1228 private: |
| 1207 DecoderTextureState* texture_state_; | 1229 DecoderTextureState* texture_state_; |
| 1208 base::TimeTicks begin_time_; | 1230 base::TimeTicks begin_time_; |
| 1209 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 1231 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
| 1210 }; | 1232 }; |
| 1211 | 1233 |
| 1212 } // namespace gles2 | 1234 } // namespace gles2 |
| 1213 } // namespace gpu | 1235 } // namespace gpu |
| 1214 | 1236 |
| 1215 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 1237 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| OLD | NEW |