OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "gpu/command_buffer/service/context_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 ContextGroup::ContextGroup( | 60 ContextGroup::ContextGroup( |
61 const GpuPreferences& gpu_preferences, | 61 const GpuPreferences& gpu_preferences, |
62 const scoped_refptr<MailboxManager>& mailbox_manager, | 62 const scoped_refptr<MailboxManager>& mailbox_manager, |
63 const scoped_refptr<MemoryTracker>& memory_tracker, | 63 const scoped_refptr<MemoryTracker>& memory_tracker, |
64 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, | 64 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, |
65 const scoped_refptr<FramebufferCompletenessCache>& | 65 const scoped_refptr<FramebufferCompletenessCache>& |
66 framebuffer_completeness_cache, | 66 framebuffer_completeness_cache, |
67 const scoped_refptr<FeatureInfo>& feature_info, | 67 const scoped_refptr<FeatureInfo>& feature_info, |
68 bool bind_generates_resource, | 68 bool bind_generates_resource, |
69 gpu::ImageFactory* image_factory, | 69 gpu::ImageFactory* image_factory, |
70 ProgressReporter* progress_reporter) | 70 ProgressReporter* progress_reporter, |
| 71 const GpuFeatureInfo& gpu_feature_info) |
71 : gpu_preferences_(gpu_preferences), | 72 : gpu_preferences_(gpu_preferences), |
72 mailbox_manager_(mailbox_manager), | 73 mailbox_manager_(mailbox_manager), |
73 memory_tracker_(memory_tracker), | 74 memory_tracker_(memory_tracker), |
74 shader_translator_cache_(shader_translator_cache), | 75 shader_translator_cache_(shader_translator_cache), |
75 #if defined(OS_MACOSX) | 76 #if defined(OS_MACOSX) |
76 // Framebuffer completeness is not cacheable on OS X because of dynamic | 77 // Framebuffer completeness is not cacheable on OS X because of dynamic |
77 // graphics switching. | 78 // graphics switching. |
78 // http://crbug.com/180876 | 79 // http://crbug.com/180876 |
79 // TODO(tobiasjs): determine whether GPU switching is possible | 80 // TODO(tobiasjs): determine whether GPU switching is possible |
80 // programmatically, rather than just hardcoding this behaviour | 81 // programmatically, rather than just hardcoding this behaviour |
(...skipping 18 matching lines...) Expand all Loading... |
99 max_fragment_input_components_(0u), | 100 max_fragment_input_components_(0u), |
100 min_program_texel_offset_(0), | 101 min_program_texel_offset_(0), |
101 max_program_texel_offset_(0), | 102 max_program_texel_offset_(0), |
102 max_transform_feedback_separate_attribs_(0u), | 103 max_transform_feedback_separate_attribs_(0u), |
103 max_uniform_buffer_bindings_(0u), | 104 max_uniform_buffer_bindings_(0u), |
104 uniform_buffer_offset_alignment_(1u), | 105 uniform_buffer_offset_alignment_(1u), |
105 program_cache_(NULL), | 106 program_cache_(NULL), |
106 feature_info_(feature_info), | 107 feature_info_(feature_info), |
107 image_factory_(image_factory), | 108 image_factory_(image_factory), |
108 passthrough_resources_(new PassthroughResources), | 109 passthrough_resources_(new PassthroughResources), |
109 progress_reporter_(progress_reporter) { | 110 progress_reporter_(progress_reporter), |
| 111 gpu_feature_info_(gpu_feature_info) { |
110 { | 112 { |
111 DCHECK(feature_info_); | 113 DCHECK(feature_info_); |
112 if (!mailbox_manager_.get()) | 114 if (!mailbox_manager_.get()) |
113 mailbox_manager_ = new MailboxManagerImpl; | 115 mailbox_manager_ = new MailboxManagerImpl; |
114 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); | 116 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); |
115 } | 117 } |
116 } | 118 } |
117 | 119 |
118 bool ContextGroup::Initialize(GLES2Decoder* decoder, | 120 bool ContextGroup::Initialize(GLES2Decoder* decoder, |
119 ContextType context_type, | 121 ContextType context_type, |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 GLuint client_id, GLuint* service_id) const { | 628 GLuint client_id, GLuint* service_id) const { |
627 Buffer* buffer = buffer_manager_->GetBuffer(client_id); | 629 Buffer* buffer = buffer_manager_->GetBuffer(client_id); |
628 if (!buffer) | 630 if (!buffer) |
629 return false; | 631 return false; |
630 *service_id = buffer->service_id(); | 632 *service_id = buffer->service_id(); |
631 return true; | 633 return true; |
632 } | 634 } |
633 | 635 |
634 } // namespace gles2 | 636 } // namespace gles2 |
635 } // namespace gpu | 637 } // namespace gpu |
OLD | NEW |