Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: cc/resources/resource_provider.h

Issue 1174733003: cc, gpu: Use RGBA when using msaa on systems that don't support BGRA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool use_persistent_map_for_gpu_memory_buffers); 89 bool use_persistent_map_for_gpu_memory_buffers);
90 virtual ~ResourceProvider(); 90 virtual ~ResourceProvider();
91 91
92 void DidLoseOutputSurface() { lost_output_surface_ = true; } 92 void DidLoseOutputSurface() { lost_output_surface_ = true; }
93 93
94 int max_texture_size() const { return max_texture_size_; } 94 int max_texture_size() const { return max_texture_size_; }
95 ResourceFormat memory_efficient_texture_format() const { 95 ResourceFormat memory_efficient_texture_format() const {
96 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; 96 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_;
97 } 97 }
98 ResourceFormat best_texture_format() const { return best_texture_format_; } 98 ResourceFormat best_texture_format() const { return best_texture_format_; }
99 ResourceFormat best_render_buffer_format() const {
100 return best_render_buffer_format_;
101 }
99 ResourceFormat yuv_resource_format() const { return yuv_resource_format_; } 102 ResourceFormat yuv_resource_format() const { return yuv_resource_format_; }
100 bool use_sync_query() const { return use_sync_query_; } 103 bool use_sync_query() const { return use_sync_query_; }
101 bool use_persistent_map_for_gpu_memory_buffers() const { 104 bool use_persistent_map_for_gpu_memory_buffers() const {
102 return use_persistent_map_for_gpu_memory_buffers_; 105 return use_persistent_map_for_gpu_memory_buffers_;
103 } 106 }
104 size_t num_resources() const { return resources_.size(); } 107 size_t num_resources() const { return resources_.size(); }
105 108
106 // Checks whether a resource is in use by a consumer. 109 // Checks whether a resource is in use by a consumer.
107 bool InUseByConsumer(ResourceId id); 110 bool InUseByConsumer(ResourceId id);
108 111
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 597
595 ResourceType default_resource_type_; 598 ResourceType default_resource_type_;
596 bool use_texture_storage_ext_; 599 bool use_texture_storage_ext_;
597 bool use_texture_format_bgra_; 600 bool use_texture_format_bgra_;
598 bool use_texture_usage_hint_; 601 bool use_texture_usage_hint_;
599 bool use_compressed_texture_etc1_; 602 bool use_compressed_texture_etc1_;
600 ResourceFormat yuv_resource_format_; 603 ResourceFormat yuv_resource_format_;
601 scoped_ptr<TextureUploader> texture_uploader_; 604 scoped_ptr<TextureUploader> texture_uploader_;
602 int max_texture_size_; 605 int max_texture_size_;
603 ResourceFormat best_texture_format_; 606 ResourceFormat best_texture_format_;
607 ResourceFormat best_render_buffer_format_;
604 608
605 base::ThreadChecker thread_checker_; 609 base::ThreadChecker thread_checker_;
606 610
607 scoped_refptr<Fence> current_read_lock_fence_; 611 scoped_refptr<Fence> current_read_lock_fence_;
608 bool use_rgba_4444_texture_format_; 612 bool use_rgba_4444_texture_format_;
609 613
610 const size_t id_allocation_chunk_size_; 614 const size_t id_allocation_chunk_size_;
611 scoped_ptr<IdAllocator> texture_id_allocator_; 615 scoped_ptr<IdAllocator> texture_id_allocator_;
612 scoped_ptr<IdAllocator> buffer_id_allocator_; 616 scoped_ptr<IdAllocator> buffer_id_allocator_;
613 617
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 return format_gl_data_format[format]; 674 return format_gl_data_format[format];
671 } 675 }
672 676
673 inline GLenum GLInternalFormat(ResourceFormat format) { 677 inline GLenum GLInternalFormat(ResourceFormat format) {
674 return GLDataFormat(format); 678 return GLDataFormat(format);
675 } 679 }
676 680
677 } // namespace cc 681 } // namespace cc
678 682
679 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 683 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698