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

Side by Side Diff: content/gpu/gpu_main.cc

Issue 1784193003: content gpu refactor: get rid of gpu related content switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the compile problem on windows Created 4 years, 9 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
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | content/public/browser/gpu_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/statistics_recorder.h" 13 #include "base/metrics/statistics_recorder.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
18 #include "base/threading/platform_thread.h" 18 #include "base/threading/platform_thread.h"
19 #include "base/trace_event/trace_event.h" 19 #include "base/trace_event/trace_event.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "content/child/child_process.h" 21 #include "content/child/child_process.h"
22 #include "content/common/content_constants_internal.h" 22 #include "content/common/content_constants_internal.h"
23 #include "content/common/gpu/gpu_config.h" 23 #include "content/common/gpu/gpu_config.h"
24 #include "content/common/gpu/gpu_host_messages.h" 24 #include "content/common/gpu/gpu_host_messages.h"
25 #include "content/common/gpu/gpu_memory_buffer_factory.h" 25 #include "content/common/gpu/gpu_memory_buffer_factory.h"
26 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
27 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
28 #include "content/common/gpu/media/gpu_video_encode_accelerator.h"
29 #include "content/common/sandbox_linux/sandbox_linux.h" 26 #include "content/common/sandbox_linux/sandbox_linux.h"
30 #include "content/gpu/gpu_child_thread.h" 27 #include "content/gpu/gpu_child_thread.h"
31 #include "content/gpu/gpu_process.h" 28 #include "content/gpu/gpu_process.h"
32 #include "content/gpu/gpu_watchdog_thread.h" 29 #include "content/gpu/gpu_watchdog_thread.h"
33 #include "content/public/common/content_client.h" 30 #include "content/public/common/content_client.h"
34 #include "content/public/common/content_switches.h" 31 #include "content/public/common/content_switches.h"
35 #include "content/public/common/main_function_params.h" 32 #include "content/public/common/main_function_params.h"
36 #include "gpu/command_buffer/service/gpu_switches.h" 33 #include "gpu/command_buffer/service/gpu_switches.h"
37 #include "gpu/command_buffer/service/sync_point_manager.h" 34 #include "gpu/command_buffer/service/sync_point_manager.h"
38 #include "gpu/config/gpu_info_collector.h" 35 #include "gpu/config/gpu_info_collector.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 374
378 if (!initialized_sandbox) { 375 if (!initialized_sandbox) {
379 gpu_info.sandboxed = StartSandboxLinux(gpu_info, watchdog_thread.get(), 376 gpu_info.sandboxed = StartSandboxLinux(gpu_info, watchdog_thread.get(),
380 should_initialize_gl_context); 377 should_initialize_gl_context);
381 } 378 }
382 #elif defined(OS_WIN) 379 #elif defined(OS_WIN)
383 gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info); 380 gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info);
384 #elif defined(OS_MACOSX) 381 #elif defined(OS_MACOSX)
385 gpu_info.sandboxed = Sandbox::SandboxIsCurrentlyActive(); 382 gpu_info.sandboxed = Sandbox::SandboxIsCurrentlyActive();
386 #endif 383 #endif
387
388 gpu_info.video_decode_accelerator_capabilities =
389 content::GpuVideoDecodeAccelerator::GetCapabilities();
390 gpu_info.video_encode_accelerator_supported_profiles =
391 content::GpuVideoEncodeAccelerator::GetSupportedProfiles();
392 gpu_info.jpeg_decode_accelerator_supported =
393 content::GpuJpegDecodeAccelerator::IsSupported();
394 } else { 384 } else {
395 dead_on_arrival = true; 385 dead_on_arrival = true;
396 } 386 }
397 387
398 logging::SetLogMessageHandler(NULL); 388 logging::SetLogMessageHandler(NULL);
399 389
400 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory; 390 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory;
401 if (GpuMemoryBufferFactory::GetNativeType() != gfx::EMPTY_BUFFER) 391 if (GpuMemoryBufferFactory::GetNativeType() != gfx::EMPTY_BUFFER)
402 gpu_memory_buffer_factory = GpuMemoryBufferFactory::CreateNativeType(); 392 gpu_memory_buffer_factory = GpuMemoryBufferFactory::CreateNativeType();
403 393
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 return true; 592 return true;
603 } 593 }
604 594
605 return false; 595 return false;
606 } 596 }
607 #endif // defined(OS_WIN) 597 #endif // defined(OS_WIN)
608 598
609 } // namespace. 599 } // namespace.
610 600
611 } // namespace content 601 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | content/public/browser/gpu_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698