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 "content/browser/gpu/gpu_data_manager_impl.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl.h" |
6 | 6 |
7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
8 #include <CoreGraphics/CGDisplayConfiguration.h> | 8 #include <CoreGraphics/CGDisplayConfiguration.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return flags; | 154 return flags; |
155 } | 155 } |
156 | 156 |
157 return gpu_feature_type_; | 157 return gpu_feature_type_; |
158 } | 158 } |
159 | 159 |
160 bool GpuDataManagerImpl::GpuAccessAllowed() { | 160 bool GpuDataManagerImpl::GpuAccessAllowed() { |
161 if (software_rendering_) | 161 if (software_rendering_) |
162 return true; | 162 return true; |
163 | 163 |
| 164 if (!gpu_info_.gpu_accessible) |
| 165 return false; |
| 166 |
164 // We only need to block GPU process if more features are disallowed other | 167 // We only need to block GPU process if more features are disallowed other |
165 // than those in the preliminary gpu feature flags because the latter work | 168 // than those in the preliminary gpu feature flags because the latter work |
166 // through renderer commandline switches. | 169 // through renderer commandline switches. |
167 uint32 mask = ~(preliminary_gpu_feature_type_); | 170 uint32 mask = ~(preliminary_gpu_feature_type_); |
168 return (gpu_feature_type_ & mask) == 0; | 171 return (gpu_feature_type_ & mask) == 0; |
169 } | 172 } |
170 | 173 |
171 void GpuDataManagerImpl::AddObserver(GpuDataManagerObserver* observer) { | 174 void GpuDataManagerImpl::AddObserver(GpuDataManagerObserver* observer) { |
172 observer_list_->AddObserver(observer); | 175 observer_list_->AddObserver(observer); |
173 } | 176 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 if (object->gl_renderer.empty()) { | 376 if (object->gl_renderer.empty()) { |
374 changed |= object->gl_renderer != other.gl_renderer; | 377 changed |= object->gl_renderer != other.gl_renderer; |
375 object->gl_renderer = other.gl_renderer; | 378 object->gl_renderer = other.gl_renderer; |
376 } | 379 } |
377 if (object->gl_extensions.empty()) { | 380 if (object->gl_extensions.empty()) { |
378 changed |= object->gl_extensions != other.gl_extensions; | 381 changed |= object->gl_extensions != other.gl_extensions; |
379 object->gl_extensions = other.gl_extensions; | 382 object->gl_extensions = other.gl_extensions; |
380 } | 383 } |
381 object->can_lose_context = other.can_lose_context; | 384 object->can_lose_context = other.can_lose_context; |
382 object->software_rendering = other.software_rendering; | 385 object->software_rendering = other.software_rendering; |
| 386 object->gpu_accessible = other.gpu_accessible; |
383 #if defined(OS_WIN) | 387 #if defined(OS_WIN) |
384 if (object->dx_diagnostics.values.size() == 0 && | 388 if (object->dx_diagnostics.values.size() == 0 && |
385 object->dx_diagnostics.children.size() == 0) { | 389 object->dx_diagnostics.children.size() == 0) { |
386 object->dx_diagnostics = other.dx_diagnostics; | 390 object->dx_diagnostics = other.dx_diagnostics; |
387 changed = true; | 391 changed = true; |
388 } | 392 } |
389 #endif | 393 #endif |
390 } | 394 } |
391 return changed; | 395 return changed; |
392 } | 396 } |
OLD | NEW |