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/user_metrics.h" | 125 #include "content/public/browser/user_metrics.h" |
126 #include "content/public/browser/worker_service.h" | 126 #include "content/public/browser/worker_service.h" |
127 #include "content/public/common/content_constants.h" | 127 #include "content/public/common/content_constants.h" |
128 #include "content/public/common/content_switches.h" | 128 #include "content/public/common/content_switches.h" |
129 #include "content/public/common/process_type.h" | 129 #include "content/public/common/process_type.h" |
130 #include "content/public/common/resource_type.h" | 130 #include "content/public/common/resource_type.h" |
131 #include "content/public/common/result_codes.h" | 131 #include "content/public/common/result_codes.h" |
132 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 132 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
133 #include "content/public/common/url_constants.h" | 133 #include "content/public/common/url_constants.h" |
134 #include "device/battery/battery_monitor_impl.h" | 134 #include "device/battery/battery_monitor_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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 | 1032 |
1031 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( | 1033 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( |
1032 gfx::GpuMemoryBuffer::MAP)) { | 1034 gfx::GpuMemoryBuffer::MAP)) { |
1033 std::vector<gfx::GpuMemoryBufferType> supported_types; | 1035 std::vector<gfx::GpuMemoryBufferType> supported_types; |
1034 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 1036 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); |
1035 DCHECK(!supported_types.empty()); | 1037 DCHECK(!supported_types.empty()); |
1036 | 1038 |
1037 // The GPU service will always use the preferred type. | 1039 // The GPU service will always use the preferred type. |
1038 gfx::GpuMemoryBufferType type = supported_types[0]; | 1040 gfx::GpuMemoryBufferType type = supported_types[0]; |
1039 | 1041 |
1040 // Surface texture backed GPU memory buffers require TEXTURE_EXTERNAL_OES. | 1042 switch (type) { |
1041 if (type == gfx::SURFACE_TEXTURE_BUFFER) | 1043 case gfx::SURFACE_TEXTURE_BUFFER: |
1042 command_line->AppendSwitch(switches::kUseImageExternal); | 1044 // Surface texture backed GPU memory buffers require |
| 1045 // TEXTURE_EXTERNAL_OES. |
| 1046 command_line->AppendSwitchASCII( |
| 1047 switches::kUseImageTextureTarget, |
| 1048 gpu::gles2::GLES2Util::GetStringEnum(GL_TEXTURE_EXTERNAL_OES)); |
| 1049 break; |
| 1050 case gfx::IO_SURFACE_BUFFER: |
| 1051 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. |
| 1052 command_line->AppendSwitchASCII( |
| 1053 switches::kUseImageTextureTarget, |
| 1054 gpu::gles2::GLES2Util::GetStringEnum(GL_TEXTURE_RECTANGLE_ARB)); |
| 1055 break; |
| 1056 default: |
| 1057 break; |
| 1058 } |
1043 } | 1059 } |
1044 | 1060 |
1045 // Appending disable-gpu-feature switches due to software rendering list. | 1061 // Appending disable-gpu-feature switches due to software rendering list. |
1046 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1062 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1047 DCHECK(gpu_data_manager); | 1063 DCHECK(gpu_data_manager); |
1048 gpu_data_manager->AppendRendererCommandLine(command_line); | 1064 gpu_data_manager->AppendRendererCommandLine(command_line); |
1049 } | 1065 } |
1050 | 1066 |
1051 void RenderProcessHostImpl::AppendRendererCommandLine( | 1067 void RenderProcessHostImpl::AppendRendererCommandLine( |
1052 base::CommandLine* command_line) const { | 1068 base::CommandLine* command_line) const { |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 | 2296 |
2281 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2297 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2282 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2298 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2283 DCHECK_GT(worker_ref_count_, 0); | 2299 DCHECK_GT(worker_ref_count_, 0); |
2284 --worker_ref_count_; | 2300 --worker_ref_count_; |
2285 if (worker_ref_count_ == 0) | 2301 if (worker_ref_count_ == 0) |
2286 Cleanup(); | 2302 Cleanup(); |
2287 } | 2303 } |
2288 | 2304 |
2289 } // namespace content | 2305 } // namespace content |
OLD | NEW |