OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/aura/gpu_process_transport_factory.h" | 5 #include "content/browser/aura/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 | 179 |
180 scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface( | 180 scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface( |
181 ui::Compositor* compositor, bool software_fallback) { | 181 ui::Compositor* compositor, bool software_fallback) { |
182 PerCompositorData* data = per_compositor_data_[compositor]; | 182 PerCompositorData* data = per_compositor_data_[compositor]; |
183 if (!data) | 183 if (!data) |
184 data = CreatePerCompositorData(compositor); | 184 data = CreatePerCompositorData(compositor); |
185 | 185 |
186 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 186 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
187 | 187 |
| 188 // Software fallback does not happen on Chrome OS. |
| 189 #if defined(OS_CHROMEOS) |
| 190 software_fallback = false; |
| 191 #endif |
| 192 |
188 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 193 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
189 if (!command_line->HasSwitch(switches::kUIEnableSoftwareCompositing) && | 194 if (!command_line->HasSwitch(switches::kUIEnableSoftwareCompositing) && |
190 !software_fallback) { | 195 !software_fallback) { |
191 context_provider = ContextProviderCommandBuffer::Create( | 196 context_provider = ContextProviderCommandBuffer::Create( |
192 GpuProcessTransportFactory::CreateContextCommon(data->surface_id), | 197 GpuProcessTransportFactory::CreateContextCommon(data->surface_id), |
193 "Compositor"); | 198 "Compositor"); |
194 } | 199 } |
195 | 200 |
196 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider); | 201 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider); |
197 | 202 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 observer_list_, | 497 observer_list_, |
493 OnLostResources()); | 498 OnLostResources()); |
494 | 499 |
495 // Kill things that use the shared context before killing the shared context. | 500 // Kill things that use the shared context before killing the shared context. |
496 lost_gl_helper.reset(); | 501 lost_gl_helper.reset(); |
497 lost_offscreen_compositor_contexts = NULL; | 502 lost_offscreen_compositor_contexts = NULL; |
498 lost_shared_main_thread_contexts = NULL; | 503 lost_shared_main_thread_contexts = NULL; |
499 } | 504 } |
500 | 505 |
501 } // namespace content | 506 } // namespace content |
OLD | NEW |