| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // by assertions. | 217 // by assertions. |
| 218 class CC_EXPORT ScopedReadLockGL { | 218 class CC_EXPORT ScopedReadLockGL { |
| 219 public: | 219 public: |
| 220 ScopedReadLockGL(ResourceProvider* resource_provider, | 220 ScopedReadLockGL(ResourceProvider* resource_provider, |
| 221 ResourceId resource_id); | 221 ResourceId resource_id); |
| 222 ~ScopedReadLockGL(); | 222 ~ScopedReadLockGL(); |
| 223 | 223 |
| 224 unsigned texture_id() const { return texture_id_; } | 224 unsigned texture_id() const { return texture_id_; } |
| 225 GLenum target() const { return target_; } | 225 GLenum target() const { return target_; } |
| 226 const gfx::Size& size() const { return size_; } | 226 const gfx::Size& size() const { return size_; } |
| 227 const gfx::ColorSpace& color_space() const { return color_space_; } |
| 227 | 228 |
| 228 private: | 229 private: |
| 229 ResourceProvider* resource_provider_; | 230 ResourceProvider* resource_provider_; |
| 230 ResourceId resource_id_; | 231 ResourceId resource_id_; |
| 231 unsigned texture_id_; | 232 unsigned texture_id_; |
| 232 GLenum target_; | 233 GLenum target_; |
| 233 gfx::Size size_; | 234 gfx::Size size_; |
| 235 gfx::ColorSpace color_space_; |
| 234 | 236 |
| 235 DISALLOW_COPY_AND_ASSIGN(ScopedReadLockGL); | 237 DISALLOW_COPY_AND_ASSIGN(ScopedReadLockGL); |
| 236 }; | 238 }; |
| 237 | 239 |
| 238 class CC_EXPORT ScopedSamplerGL { | 240 class CC_EXPORT ScopedSamplerGL { |
| 239 public: | 241 public: |
| 240 ScopedSamplerGL(ResourceProvider* resource_provider, | 242 ScopedSamplerGL(ResourceProvider* resource_provider, |
| 241 ResourceId resource_id, | 243 ResourceId resource_id, |
| 242 GLenum filter); | 244 GLenum filter); |
| 243 ScopedSamplerGL(ResourceProvider* resource_provider, | 245 ScopedSamplerGL(ResourceProvider* resource_provider, |
| 244 ResourceId resource_id, | 246 ResourceId resource_id, |
| 245 GLenum unit, | 247 GLenum unit, |
| 246 GLenum filter); | 248 GLenum filter); |
| 247 ~ScopedSamplerGL(); | 249 ~ScopedSamplerGL(); |
| 248 | 250 |
| 249 unsigned texture_id() const { return resource_lock_.texture_id(); } | 251 unsigned texture_id() const { return resource_lock_.texture_id(); } |
| 250 GLenum target() const { return target_; } | 252 GLenum target() const { return target_; } |
| 253 const gfx::ColorSpace& color_space() const { |
| 254 return resource_lock_.color_space(); |
| 255 } |
| 251 | 256 |
| 252 private: | 257 private: |
| 253 ScopedReadLockGL resource_lock_; | 258 ScopedReadLockGL resource_lock_; |
| 254 GLenum unit_; | 259 GLenum unit_; |
| 255 GLenum target_; | 260 GLenum target_; |
| 256 | 261 |
| 257 DISALLOW_COPY_AND_ASSIGN(ScopedSamplerGL); | 262 DISALLOW_COPY_AND_ASSIGN(ScopedSamplerGL); |
| 258 }; | 263 }; |
| 259 | 264 |
| 260 class CC_EXPORT ScopedWriteLockGL { | 265 class CC_EXPORT ScopedWriteLockGL { |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // A process-unique ID used for disambiguating memory dumps from different | 713 // A process-unique ID used for disambiguating memory dumps from different |
| 709 // resource providers. | 714 // resource providers. |
| 710 int tracing_id_; | 715 int tracing_id_; |
| 711 | 716 |
| 712 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 717 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 713 }; | 718 }; |
| 714 | 719 |
| 715 } // namespace cc | 720 } // namespace cc |
| 716 | 721 |
| 717 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 722 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |