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

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

Issue 1251693003: cc: Fix the format of GpuMemoryBuffer for SurfaceTexture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the targets to ResourceProvider and fix the nits Created 5 years, 4 months 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 void Release(int old_route_id) { 392 void Release(int old_route_id) {
393 session_storage_namespaces_awaiting_close_.erase(old_route_id); 393 session_storage_namespaces_awaiting_close_.erase(old_route_id);
394 } 394 }
395 395
396 private: 396 private:
397 std::map<int, SessionStorageNamespaceMap > 397 std::map<int, SessionStorageNamespaceMap >
398 session_storage_namespaces_awaiting_close_; 398 session_storage_namespaces_awaiting_close_;
399 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder); 399 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder);
400 }; 400 };
401 401
402 std::string UintVectorToString(const std::vector<unsigned>& vector) {
403 std::string str;
404 for (auto it : vector) {
405 if (!str.empty())
406 str += ",";
407 str += base::UintToString(it);
408 }
409 return str;
410 }
411
402 } // namespace 412 } // namespace
403 413
404 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; 414 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
405 415
406 base::MessageLoop* g_in_process_thread; 416 base::MessageLoop* g_in_process_thread;
407 417
408 base::MessageLoop* 418 base::MessageLoop*
409 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { 419 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() {
410 return g_in_process_thread; 420 return g_in_process_thread;
411 } 421 }
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); 1138 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled());
1129 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); 1139 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled());
1130 if (IsZeroCopyUploadEnabled()) 1140 if (IsZeroCopyUploadEnabled())
1131 command_line->AppendSwitch(switches::kEnableZeroCopy); 1141 command_line->AppendSwitch(switches::kEnableZeroCopy);
1132 if (!IsOneCopyUploadEnabled()) 1142 if (!IsOneCopyUploadEnabled())
1133 command_line->AppendSwitch(switches::kDisableOneCopy); 1143 command_line->AppendSwitch(switches::kDisableOneCopy);
1134 1144
1135 if (IsForceGpuRasterizationEnabled()) 1145 if (IsForceGpuRasterizationEnabled())
1136 command_line->AppendSwitch(switches::kForceGpuRasterization); 1146 command_line->AppendSwitch(switches::kForceGpuRasterization);
1137 1147
1138 command_line->AppendSwitchASCII( 1148 std::vector<unsigned> image_targets(gfx::GpuMemoryBuffer::FORMAT_LAST + 1,
1139 switches::kContentImageTextureTarget, 1149 GL_TEXTURE_2D);
1140 base::UintToString( 1150 for (size_t format = 0; format < gfx::GpuMemoryBuffer::FORMAT_LAST + 1;
1141 // TODO(reveman): We currently assume that the compositor will use 1151 format++) {
1142 // BGRA_8888 if it's able to, and RGBA_8888 otherwise. Since we don't 1152 image_targets[format] =
1143 // know what it will use we hardcode BGRA_8888 here for now. We should 1153 BrowserGpuMemoryBufferManager::GetImageTextureTarget(
1144 // instead move decisions about GpuMemoryBuffer format to the browser 1154 static_cast<gfx::GpuMemoryBuffer::Format>(format),
1145 // embedder so we know it here, and pass that decision to the 1155 // TODO(danakj): When one-copy supports partial update, change
1146 // compositor for each usage. 1156 // this usage to PERSISTENT_MAP for one-copy.
1147 // crbug.com/490362 1157 gfx::GpuMemoryBuffer::MAP);
1148 BrowserGpuMemoryBufferManager::GetImageTextureTarget( 1158 }
1149 gfx::GpuMemoryBuffer::BGRA_8888, 1159 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget,
1150 // TODO(danakj): When one-copy supports partial update, change 1160 UintVectorToString(image_targets));
1151 // this usage to PERSISTENT_MAP for one-copy.
1152 gfx::GpuMemoryBuffer::MAP)));
1153 1161
1154 command_line->AppendSwitchASCII( 1162 command_line->AppendSwitchASCII(
1155 switches::kVideoImageTextureTarget, 1163 switches::kVideoImageTextureTarget,
1156 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( 1164 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget(
1157 gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP))); 1165 gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP)));
1158 1166
1159 // Appending disable-gpu-feature switches due to software rendering list. 1167 // Appending disable-gpu-feature switches due to software rendering list.
1160 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 1168 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
1161 DCHECK(gpu_data_manager); 1169 DCHECK(gpu_data_manager);
1162 gpu_data_manager->AppendRendererCommandLine(command_line); 1170 gpu_data_manager->AppendRendererCommandLine(command_line);
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 void RenderProcessHostImpl::GetAudioOutputControllers( 2518 void RenderProcessHostImpl::GetAudioOutputControllers(
2511 const GetAudioOutputControllersCallback& callback) const { 2519 const GetAudioOutputControllersCallback& callback) const {
2512 audio_renderer_host()->GetOutputControllers(callback); 2520 audio_renderer_host()->GetOutputControllers(callback);
2513 } 2521 }
2514 2522
2515 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { 2523 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() {
2516 return bluetooth_dispatcher_host_.get(); 2524 return bluetooth_dispatcher_host_.get();
2517 } 2525 }
2518 2526
2519 } // namespace content 2527 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698