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

Side by Side Diff: gpu/command_buffer/service/context_group.cc

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 (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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 adjusted_disallowed_features.ext_color_buffer_float = true; 52 adjusted_disallowed_features.ext_color_buffer_float = true;
53 adjusted_disallowed_features.oes_texture_float_linear = true; 53 adjusted_disallowed_features.oes_texture_float_linear = true;
54 } 54 }
55 return adjusted_disallowed_features; 55 return adjusted_disallowed_features;
56 } 56 }
57 57
58 } // namespace anonymous 58 } // namespace anonymous
59 59
60 ContextGroup::ContextGroup( 60 ContextGroup::ContextGroup(
61 const GpuPreferences& gpu_preferences, 61 const GpuPreferences& gpu_preferences,
62 const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds,
62 const scoped_refptr<MailboxManager>& mailbox_manager, 63 const scoped_refptr<MailboxManager>& mailbox_manager,
63 const scoped_refptr<MemoryTracker>& memory_tracker, 64 const scoped_refptr<MemoryTracker>& memory_tracker,
64 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, 65 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache,
65 const scoped_refptr<FramebufferCompletenessCache>& 66 const scoped_refptr<FramebufferCompletenessCache>&
66 framebuffer_completeness_cache, 67 framebuffer_completeness_cache,
67 const scoped_refptr<FeatureInfo>& feature_info, 68 const scoped_refptr<FeatureInfo>& feature_info,
68 const scoped_refptr<SubscriptionRefSet>& subscription_ref_set, 69 const scoped_refptr<SubscriptionRefSet>& subscription_ref_set,
69 const scoped_refptr<ValueStateMap>& pending_valuebuffer_state, 70 const scoped_refptr<ValueStateMap>& pending_valuebuffer_state,
70 bool bind_generates_resource) 71 bool bind_generates_resource)
71 : gpu_preferences_(gpu_preferences), 72 : gpu_preferences_(gpu_preferences),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 program_cache_(NULL), 105 program_cache_(NULL),
105 feature_info_(feature_info) { 106 feature_info_(feature_info) {
106 { 107 {
107 if (!mailbox_manager_.get()) 108 if (!mailbox_manager_.get())
108 mailbox_manager_ = new MailboxManagerImpl; 109 mailbox_manager_ = new MailboxManagerImpl;
109 if (!subscription_ref_set_.get()) 110 if (!subscription_ref_set_.get())
110 subscription_ref_set_ = new SubscriptionRefSet(); 111 subscription_ref_set_ = new SubscriptionRefSet();
111 if (!pending_valuebuffer_state_.get()) 112 if (!pending_valuebuffer_state_.get())
112 pending_valuebuffer_state_ = new ValueStateMap(); 113 pending_valuebuffer_state_ = new ValueStateMap();
113 if (!feature_info.get()) 114 if (!feature_info.get())
114 feature_info_ = new FeatureInfo; 115 feature_info_ = new FeatureInfo(gpu_driver_bug_workarounds);
115 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); 116 transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get());
116 } 117 }
117 } 118 }
118 119
119 bool ContextGroup::Initialize(GLES2Decoder* decoder, 120 bool ContextGroup::Initialize(GLES2Decoder* decoder,
120 ContextType context_type, 121 ContextType context_type,
121 const DisallowedFeatures& disallowed_features) { 122 const DisallowedFeatures& disallowed_features) {
122 if (HaveContexts()) { 123 if (HaveContexts()) {
123 if (context_type != feature_info_->context_type()) { 124 if (context_type != feature_info_->context_type()) {
124 LOG(ERROR) << "ContextGroup::Initialize failed because the type of " 125 LOG(ERROR) << "ContextGroup::Initialize failed because the type of "
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 GLuint client_id, GLuint* service_id) const { 567 GLuint client_id, GLuint* service_id) const {
567 Buffer* buffer = buffer_manager_->GetBuffer(client_id); 568 Buffer* buffer = buffer_manager_->GetBuffer(client_id);
568 if (!buffer) 569 if (!buffer)
569 return false; 570 return false;
570 *service_id = buffer->service_id(); 571 *service_id = buffer->service_id();
571 return true; 572 return true;
572 } 573 }
573 574
574 } // namespace gles2 575 } // namespace gles2
575 } // namespace gpu 576 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698