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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1030 | 1030 |
1031 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( | 1031 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( |
1032 gfx::GpuMemoryBuffer::MAP)) { | 1032 gfx::GpuMemoryBuffer::MAP)) { |
1033 std::vector<gfx::GpuMemoryBufferType> supported_types; | 1033 std::vector<gfx::GpuMemoryBufferType> supported_types; |
1034 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 1034 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); |
1035 DCHECK(!supported_types.empty()); | 1035 DCHECK(!supported_types.empty()); |
1036 | 1036 |
1037 // The GPU service will always use the preferred type. | 1037 // The GPU service will always use the preferred type. |
1038 gfx::GpuMemoryBufferType type = supported_types[0]; | 1038 gfx::GpuMemoryBufferType type = supported_types[0]; |
1039 | 1039 |
1040 // Surface texture backed GPU memory buffers require TEXTURE_EXTERNAL_OES. | 1040 switch (type) { |
1041 if (type == gfx::SURFACE_TEXTURE_BUFFER) | 1041 case gfx::SURFACE_TEXTURE_BUFFER: |
1042 command_line->AppendSwitch(switches::kUseImageExternal); | 1042 // Surface texture backed GPU memory buffers require |
1043 // TEXTURE_EXTERNAL_OES. | |
1044 command_line->AppendSwitchASCII(switches::kUseImageTextureTarget, | |
1045 "external"); | |
piman
2014/12/03 21:16:50
nit: can you make "external" and "rectangle" a glo
dshwang
2014/12/04 09:21:14
That's good idea. Done.
in content_switches.cc
//
| |
1046 break; | |
1047 case gfx::IO_SURFACE_BUFFER: | |
1048 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. | |
1049 command_line->AppendSwitchASCII(switches::kUseImageTextureTarget, | |
1050 "rectangle"); | |
1051 break; | |
1052 default: | |
1053 break; | |
1054 } | |
1043 } | 1055 } |
1044 | 1056 |
1045 // Appending disable-gpu-feature switches due to software rendering list. | 1057 // Appending disable-gpu-feature switches due to software rendering list. |
1046 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1058 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1047 DCHECK(gpu_data_manager); | 1059 DCHECK(gpu_data_manager); |
1048 gpu_data_manager->AppendRendererCommandLine(command_line); | 1060 gpu_data_manager->AppendRendererCommandLine(command_line); |
1049 } | 1061 } |
1050 | 1062 |
1051 void RenderProcessHostImpl::AppendRendererCommandLine( | 1063 void RenderProcessHostImpl::AppendRendererCommandLine( |
1052 base::CommandLine* command_line) const { | 1064 base::CommandLine* command_line) const { |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2280 | 2292 |
2281 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2293 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2282 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2294 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2283 DCHECK_GT(worker_ref_count_, 0); | 2295 DCHECK_GT(worker_ref_count_, 0); |
2284 --worker_ref_count_; | 2296 --worker_ref_count_; |
2285 if (worker_ref_count_ == 0) | 2297 if (worker_ref_count_ == 0) |
2286 Cleanup(); | 2298 Cleanup(); |
2287 } | 2299 } |
2288 | 2300 |
2289 } // namespace content | 2301 } // namespace content |
OLD | NEW |