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_RESOURCES_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_ |
6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 DISALLOW_COPY_AND_ASSIGN(ScopedSamplerGL); | 243 DISALLOW_COPY_AND_ASSIGN(ScopedSamplerGL); |
244 }; | 244 }; |
245 | 245 |
246 class CC_EXPORT ScopedWriteLockGL { | 246 class CC_EXPORT ScopedWriteLockGL { |
247 public: | 247 public: |
248 ScopedWriteLockGL(ResourceProvider* resource_provider, | 248 ScopedWriteLockGL(ResourceProvider* resource_provider, |
249 ResourceProvider::ResourceId resource_id); | 249 ResourceProvider::ResourceId resource_id); |
250 ~ScopedWriteLockGL(); | 250 ~ScopedWriteLockGL(); |
251 | 251 |
252 unsigned texture_id() const { return texture_id_; } | 252 unsigned texture_id() const { return texture_id_; } |
| 253 ResourceFormat format() const { return format_; } |
253 | 254 |
254 private: | 255 private: |
255 ResourceProvider* resource_provider_; | 256 ResourceProvider* resource_provider_; |
256 ResourceProvider::ResourceId resource_id_; | 257 ResourceProvider::ResourceId resource_id_; |
257 unsigned texture_id_; | 258 unsigned texture_id_; |
| 259 ResourceFormat format_; |
258 | 260 |
259 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGL); | 261 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGL); |
260 }; | 262 }; |
261 | 263 |
262 class CC_EXPORT ScopedReadLockSoftware { | 264 class CC_EXPORT ScopedReadLockSoftware { |
263 public: | 265 public: |
264 ScopedReadLockSoftware(ResourceProvider* resource_provider, | 266 ScopedReadLockSoftware(ResourceProvider* resource_provider, |
265 ResourceProvider::ResourceId resource_id); | 267 ResourceProvider::ResourceId resource_id); |
266 ~ScopedReadLockSoftware(); | 268 ~ScopedReadLockSoftware(); |
267 | 269 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 return format_gl_data_format[format]; | 553 return format_gl_data_format[format]; |
552 } | 554 } |
553 | 555 |
554 inline GLenum GLInternalFormat(ResourceFormat format) { | 556 inline GLenum GLInternalFormat(ResourceFormat format) { |
555 return GLDataFormat(format); | 557 return GLDataFormat(format); |
556 } | 558 } |
557 | 559 |
558 } // namespace cc | 560 } // namespace cc |
559 | 561 |
560 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 562 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |