| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 ~ScopedWriteLockSoftware(); | 297 ~ScopedWriteLockSoftware(); |
| 298 | 298 |
| 299 SkCanvas* sk_canvas() { return sk_canvas_.get(); } | 299 SkCanvas* sk_canvas() { return sk_canvas_.get(); } |
| 300 bool valid() const { return !!sk_bitmap_.getPixels(); } | 300 bool valid() const { return !!sk_bitmap_.getPixels(); } |
| 301 | 301 |
| 302 private: | 302 private: |
| 303 ResourceProvider* resource_provider_; | 303 ResourceProvider* resource_provider_; |
| 304 ResourceProvider::Resource* resource_; | 304 ResourceProvider::Resource* resource_; |
| 305 SkBitmap sk_bitmap_; | 305 SkBitmap sk_bitmap_; |
| 306 scoped_ptr<SkCanvas> sk_canvas_; | 306 scoped_ptr<SkCanvas> sk_canvas_; |
| 307 base::ThreadChecker thread_checker_; |
| 307 | 308 |
| 308 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); | 309 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); |
| 309 }; | 310 }; |
| 310 | 311 |
| 311 class CC_EXPORT ScopedWriteLockGpuMemoryBuffer { | 312 class CC_EXPORT ScopedWriteLockGpuMemoryBuffer { |
| 312 public: | 313 public: |
| 313 ScopedWriteLockGpuMemoryBuffer(ResourceProvider* resource_provider, | 314 ScopedWriteLockGpuMemoryBuffer(ResourceProvider* resource_provider, |
| 314 ResourceProvider::ResourceId resource_id); | 315 ResourceProvider::ResourceId resource_id); |
| 315 ~ScopedWriteLockGpuMemoryBuffer(); | 316 ~ScopedWriteLockGpuMemoryBuffer(); |
| 316 | 317 |
| 317 gfx::GpuMemoryBuffer* GetGpuMemoryBuffer(); | 318 gfx::GpuMemoryBuffer* GetGpuMemoryBuffer(); |
| 318 | 319 |
| 319 private: | 320 private: |
| 320 ResourceProvider* resource_provider_; | 321 ResourceProvider* resource_provider_; |
| 321 ResourceProvider::Resource* resource_; | 322 ResourceProvider::Resource* resource_; |
| 322 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 323 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 323 gfx::GpuMemoryBuffer* gpu_memory_buffer_; | 324 gfx::GpuMemoryBuffer* gpu_memory_buffer_; |
| 324 gfx::Size size_; | 325 gfx::Size size_; |
| 325 ResourceFormat format_; | 326 ResourceFormat format_; |
| 327 base::ThreadChecker thread_checker_; |
| 326 | 328 |
| 327 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); | 329 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); |
| 328 }; | 330 }; |
| 329 | 331 |
| 330 class CC_EXPORT ScopedWriteLockGr { | 332 class CC_EXPORT ScopedWriteLockGr { |
| 331 public: | 333 public: |
| 332 ScopedWriteLockGr(ResourceProvider* resource_provider, | 334 ScopedWriteLockGr(ResourceProvider* resource_provider, |
| 333 ResourceProvider::ResourceId resource_id); | 335 ResourceProvider::ResourceId resource_id); |
| 334 ~ScopedWriteLockGr(); | 336 ~ScopedWriteLockGr(); |
| 335 | 337 |
| 336 SkSurface* GetSkSurface(bool use_distance_field_text); | 338 SkSurface* GetSkSurface(bool use_distance_field_text); |
| 337 | 339 |
| 338 private: | 340 private: |
| 339 ResourceProvider* resource_provider_; | 341 ResourceProvider* resource_provider_; |
| 340 ResourceProvider::Resource* resource_; | 342 ResourceProvider::Resource* resource_; |
| 343 base::ThreadChecker thread_checker_; |
| 341 | 344 |
| 342 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr); | 345 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr); |
| 343 }; | 346 }; |
| 344 | 347 |
| 345 class Fence : public base::RefCounted<Fence> { | 348 class Fence : public base::RefCounted<Fence> { |
| 346 public: | 349 public: |
| 347 Fence() {} | 350 Fence() {} |
| 348 | 351 |
| 349 virtual void Set() = 0; | 352 virtual void Set() = 0; |
| 350 virtual bool HasPassed() = 0; | 353 virtual bool HasPassed() = 0; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 return format_gl_data_format[format]; | 640 return format_gl_data_format[format]; |
| 638 } | 641 } |
| 639 | 642 |
| 640 inline GLenum GLInternalFormat(ResourceFormat format) { | 643 inline GLenum GLInternalFormat(ResourceFormat format) { |
| 641 return GLDataFormat(format); | 644 return GLDataFormat(format); |
| 642 } | 645 } |
| 643 | 646 |
| 644 } // namespace cc | 647 } // namespace cc |
| 645 | 648 |
| 646 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 649 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |