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/android/content_startup_flags.h" | 5 #include "content/browser/android/content_startup_flags.h" |
6 | 6 |
7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
12 #include "cc/base/switches.h" | 12 #include "cc/base/switches.h" |
| 13 #include "cc/output/buffer_to_texture_target_map.h" |
13 #include "content/public/browser/android/compositor.h" | 14 #include "content/public/browser/android/compositor.h" |
14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
15 #include "gpu/command_buffer/service/gpu_switches.h" | 16 #include "gpu/command_buffer/service/gpu_switches.h" |
| 17 #include "gpu/ipc/host/gpu_memory_buffer_support.h" |
16 #include "ui/base/ui_base_switches.h" | 18 #include "ui/base/ui_base_switches.h" |
| 19 #include "ui/gfx/buffer_types.h" |
17 | 20 |
18 namespace content { | 21 namespace content { |
19 | 22 |
20 void SetContentCommandLineFlags(bool single_process, | 23 void SetContentCommandLineFlags(bool single_process, |
21 const std::string& plugin_descriptor) { | 24 const std::string& plugin_descriptor) { |
22 // May be called multiple times, to cover all possible program entry points. | 25 // May be called multiple times, to cover all possible program entry points. |
23 static bool already_initialized = false; | 26 static bool already_initialized = false; |
24 if (already_initialized) | 27 if (already_initialized) |
25 return; | 28 return; |
26 already_initialized = true; | 29 already_initialized = true; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (!plugin_descriptor.empty()) { | 71 if (!plugin_descriptor.empty()) { |
69 parsed_command_line->AppendSwitchNative( | 72 parsed_command_line->AppendSwitchNative( |
70 switches::kRegisterPepperPlugins, plugin_descriptor); | 73 switches::kRegisterPepperPlugins, plugin_descriptor); |
71 } | 74 } |
72 | 75 |
73 // Disable profiler timing by default. | 76 // Disable profiler timing by default. |
74 if (!parsed_command_line->HasSwitch(switches::kProfilerTiming)) { | 77 if (!parsed_command_line->HasSwitch(switches::kProfilerTiming)) { |
75 parsed_command_line->AppendSwitchASCII( | 78 parsed_command_line->AppendSwitchASCII( |
76 switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); | 79 switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); |
77 } | 80 } |
| 81 |
| 82 cc::BufferToTextureTargetMap image_targets; |
| 83 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); |
| 84 ++usage_idx) { |
| 85 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); |
| 86 for (int format_idx = 0; |
| 87 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); |
| 88 ++format_idx) { |
| 89 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); |
| 90 uint32_t target = gpu::GetImageTextureTarget(format, usage); |
| 91 image_targets[std::make_pair(usage, format)] = target; |
| 92 } |
| 93 } |
| 94 parsed_command_line->AppendSwitchASCII( |
| 95 switches::kBrowserContentImageTextureTarget, |
| 96 cc::BufferToTextureTargetMapToString(image_targets)); |
78 } | 97 } |
79 | 98 |
80 } // namespace content | 99 } // namespace content |
OLD | NEW |