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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 void SetServiceId(GLuint service_id) { | 149 void SetServiceId(GLuint service_id) { |
150 DCHECK(service_id); | 150 DCHECK(service_id); |
151 DCHECK_EQ(owned_service_id_, service_id_); | 151 DCHECK_EQ(owned_service_id_, service_id_); |
152 service_id_ = service_id; | 152 service_id_ = service_id; |
153 owned_service_id_ = service_id; | 153 owned_service_id_ = service_id; |
154 } | 154 } |
155 | 155 |
156 // Causes us to report |service_id| as our service id, but does not delete | 156 // Causes us to report |service_id| as our service id, but does not delete |
157 // it when we are destroyed. Will rebind any OES_EXTERNAL texture units to | 157 // it when we are destroyed. Will rebind any OES_EXTERNAL texture units to |
158 // our new service id in all contexts. If |service_id| is zero, then we | 158 // our new service id in all contexts. If |service_id| is zero, then we |
159 // revert to our original service id. | 159 // revert to our original service id. The unowned service id is automatically |
| 160 // reset whenever an image is bound to this Texture to ensure the unowned id |
| 161 // doesn't outlive the image that owns it. |
160 void SetUnownedServiceId(GLuint service_id); | 162 void SetUnownedServiceId(GLuint service_id); |
161 | 163 |
162 // Returns the target this texure was first bound to or 0 if it has not | 164 // Returns the target this texure was first bound to or 0 if it has not |
163 // been bound. Once a texture is bound to a specific target it can never be | 165 // been bound. Once a texture is bound to a specific target it can never be |
164 // bound to a different target. | 166 // bound to a different target. |
165 GLenum target() const { | 167 GLenum target() const { |
166 return target_; | 168 return target_; |
167 } | 169 } |
168 | 170 |
169 bool SafeToRenderFrom() const { | 171 bool SafeToRenderFrom() const { |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 private: | 1177 private: |
1176 DecoderTextureState* texture_state_; | 1178 DecoderTextureState* texture_state_; |
1177 base::TimeTicks begin_time_; | 1179 base::TimeTicks begin_time_; |
1178 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 1180 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
1179 }; | 1181 }; |
1180 | 1182 |
1181 } // namespace gles2 | 1183 } // namespace gles2 |
1182 } // namespace gpu | 1184 } // namespace gpu |
1183 | 1185 |
1184 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 1186 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |