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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 766663005: cc: zero/one-copy based on shared memory on IOS uses GL_TEXTURE_2D, not GL_TEXTURE_RECTANGLE_ARB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make "external" and "rectangle" a global constant Created 6 years 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 | « cc/trees/layer_tree_settings.cc ('k') | content/public/common/content_switches.h » ('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 // 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
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 switches::kImageTextureExternal);
reveman 2014/12/04 17:03:25 can we use GLES2Util::GetStringEnum(GL_TEXTURE_EXT
1046 break;
1047 case gfx::IO_SURFACE_BUFFER:
1048 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB.
1049 command_line->AppendSwitchASCII(switches::kUseImageTextureTarget,
1050 switches::kImageTextureRectangle);
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698