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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 ~ScopedWriteLockGr(); | 340 ~ScopedWriteLockGr(); |
341 | 341 |
342 void InitSkSurface(bool use_distance_field_text, | 342 void InitSkSurface(bool use_distance_field_text, |
343 bool can_use_lcd_text, | 343 bool can_use_lcd_text, |
344 int msaa_sample_count); | 344 int msaa_sample_count); |
345 void ReleaseSkSurface(); | 345 void ReleaseSkSurface(); |
346 | 346 |
347 SkSurface* sk_surface() { return sk_surface_.get(); } | 347 SkSurface* sk_surface() { return sk_surface_.get(); } |
348 | 348 |
349 gfx::Size GetResourceSize() const { return resource_->size; } | 349 gfx::Size GetResourceSize() const { return resource_->size; } |
| 350 ResourceFormat GetResourceFormat() const { return resource_->format; } |
350 | 351 |
351 void UpdateResourceSyncToken(const gpu::SyncToken& sync_token) { | 352 void UpdateResourceSyncToken(const gpu::SyncToken& sync_token) { |
352 set_sync_token_ = true; | 353 set_sync_token_ = true; |
353 sync_token_ = sync_token; | 354 sync_token_ = sync_token; |
354 } | 355 } |
355 | 356 |
356 private: | 357 private: |
357 ResourceProvider* resource_provider_; | 358 ResourceProvider* resource_provider_; |
358 ResourceProvider::Resource* resource_; | 359 ResourceProvider::Resource* resource_; |
359 base::ThreadChecker thread_checker_; | 360 base::ThreadChecker thread_checker_; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 const size_t id_allocation_chunk_size_; | 672 const size_t id_allocation_chunk_size_; |
672 std::unique_ptr<IdAllocator> texture_id_allocator_; | 673 std::unique_ptr<IdAllocator> texture_id_allocator_; |
673 std::unique_ptr<IdAllocator> buffer_id_allocator_; | 674 std::unique_ptr<IdAllocator> buffer_id_allocator_; |
674 | 675 |
675 bool use_sync_query_; | 676 bool use_sync_query_; |
676 std::vector<unsigned> use_image_texture_targets_; | 677 std::vector<unsigned> use_image_texture_targets_; |
677 | 678 |
678 // A process-unique ID used for disambiguating memory dumps from different | 679 // A process-unique ID used for disambiguating memory dumps from different |
679 // resource providers. | 680 // resource providers. |
680 int tracing_id_; | 681 int tracing_id_; |
681 | 682 friend class GpuRasterizer; |
682 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 683 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
683 }; | 684 }; |
684 | 685 |
685 } // namespace cc | 686 } // namespace cc |
686 | 687 |
687 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 688 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |