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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 #include "content/public/browser/worker_service.h" | 125 #include "content/public/browser/worker_service.h" |
126 #include "content/public/common/content_constants.h" | 126 #include "content/public/common/content_constants.h" |
127 #include "content/public/common/content_switches.h" | 127 #include "content/public/common/content_switches.h" |
128 #include "content/public/common/process_type.h" | 128 #include "content/public/common/process_type.h" |
129 #include "content/public/common/resource_type.h" | 129 #include "content/public/common/resource_type.h" |
130 #include "content/public/common/result_codes.h" | 130 #include "content/public/common/result_codes.h" |
131 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 131 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
132 #include "content/public/common/url_constants.h" | 132 #include "content/public/common/url_constants.h" |
133 #include "device/battery/battery_monitor_impl.h" | 133 #include "device/battery/battery_monitor_impl.h" |
134 #include "device/vibration/vibration_manager_impl.h" | 134 #include "device/vibration/vibration_manager_impl.h" |
| 135 #include "gpu/GLES2/gl2extchromium.h" |
135 #include "gpu/command_buffer/client/gpu_switches.h" | 136 #include "gpu/command_buffer/client/gpu_switches.h" |
| 137 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
136 #include "gpu/command_buffer/service/gpu_switches.h" | 138 #include "gpu/command_buffer/service/gpu_switches.h" |
137 #include "ipc/ipc_channel.h" | 139 #include "ipc/ipc_channel.h" |
138 #include "ipc/ipc_logging.h" | 140 #include "ipc/ipc_logging.h" |
139 #include "ipc/ipc_switches.h" | 141 #include "ipc/ipc_switches.h" |
140 #include "ipc/mojo/ipc_channel_mojo.h" | 142 #include "ipc/mojo/ipc_channel_mojo.h" |
141 #include "ipc/mojo/ipc_channel_mojo_host.h" | 143 #include "ipc/mojo/ipc_channel_mojo_host.h" |
142 #include "media/base/media_switches.h" | 144 #include "media/base/media_switches.h" |
143 #include "net/url_request/url_request_context_getter.h" | 145 #include "net/url_request/url_request_context_getter.h" |
144 #include "ppapi/shared_impl/ppapi_switches.h" | 146 #include "ppapi/shared_impl/ppapi_switches.h" |
145 #include "storage/browser/fileapi/sandbox_file_system_backend.h" | 147 #include "storage/browser/fileapi/sandbox_file_system_backend.h" |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 | 1037 |
1036 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( | 1038 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( |
1037 gfx::GpuMemoryBuffer::MAP)) { | 1039 gfx::GpuMemoryBuffer::MAP)) { |
1038 std::vector<gfx::GpuMemoryBufferType> supported_types; | 1040 std::vector<gfx::GpuMemoryBufferType> supported_types; |
1039 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 1041 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); |
1040 DCHECK(!supported_types.empty()); | 1042 DCHECK(!supported_types.empty()); |
1041 | 1043 |
1042 // The GPU service will always use the preferred type. | 1044 // The GPU service will always use the preferred type. |
1043 gfx::GpuMemoryBufferType type = supported_types[0]; | 1045 gfx::GpuMemoryBufferType type = supported_types[0]; |
1044 | 1046 |
1045 // Surface texture backed GPU memory buffers require TEXTURE_EXTERNAL_OES. | 1047 switch (type) { |
1046 if (type == gfx::SURFACE_TEXTURE_BUFFER) | 1048 case gfx::SURFACE_TEXTURE_BUFFER: |
1047 command_line->AppendSwitch(switches::kUseImageExternal); | 1049 // Surface texture backed GPU memory buffers require |
| 1050 // TEXTURE_EXTERNAL_OES. |
| 1051 command_line->AppendSwitchASCII( |
| 1052 switches::kUseImageTextureTarget, |
| 1053 gpu::gles2::GLES2Util::GetStringEnum(GL_TEXTURE_EXTERNAL_OES)); |
| 1054 break; |
| 1055 case gfx::IO_SURFACE_BUFFER: |
| 1056 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. |
| 1057 command_line->AppendSwitchASCII( |
| 1058 switches::kUseImageTextureTarget, |
| 1059 gpu::gles2::GLES2Util::GetStringEnum(GL_TEXTURE_RECTANGLE_ARB)); |
| 1060 break; |
| 1061 default: |
| 1062 break; |
| 1063 } |
1048 } | 1064 } |
1049 | 1065 |
1050 // Appending disable-gpu-feature switches due to software rendering list. | 1066 // Appending disable-gpu-feature switches due to software rendering list. |
1051 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1067 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1052 DCHECK(gpu_data_manager); | 1068 DCHECK(gpu_data_manager); |
1053 gpu_data_manager->AppendRendererCommandLine(command_line); | 1069 gpu_data_manager->AppendRendererCommandLine(command_line); |
1054 } | 1070 } |
1055 | 1071 |
1056 void RenderProcessHostImpl::AppendRendererCommandLine( | 1072 void RenderProcessHostImpl::AppendRendererCommandLine( |
1057 base::CommandLine* command_line) const { | 1073 base::CommandLine* command_line) const { |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 | 2313 |
2298 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2314 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2299 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2315 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2300 DCHECK_GT(worker_ref_count_, 0); | 2316 DCHECK_GT(worker_ref_count_, 0); |
2301 --worker_ref_count_; | 2317 --worker_ref_count_; |
2302 if (worker_ref_count_ == 0) | 2318 if (worker_ref_count_ == 0) |
2303 Cleanup(); | 2319 Cleanup(); |
2304 } | 2320 } |
2305 | 2321 |
2306 } // namespace content | 2322 } // namespace content |
OLD | NEW |