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

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: rebase 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 void Release(int old_route_id) { 397 void Release(int old_route_id) {
398 session_storage_namespaces_awaiting_close_.erase(old_route_id); 398 session_storage_namespaces_awaiting_close_.erase(old_route_id);
399 } 399 }
400 400
401 private: 401 private:
402 std::map<int, SessionStorageNamespaceMap > 402 std::map<int, SessionStorageNamespaceMap >
403 session_storage_namespaces_awaiting_close_; 403 session_storage_namespaces_awaiting_close_;
404 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder); 404 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder);
405 }; 405 };
406 406
407 std::string UintVectorToString(const std::vector<unsigned>& vector) {
408 std::string str;
409 for (auto it : vector) {
410 if (!str.empty())
411 str += ",";
412 str += base::UintToString(it);
413 }
414 return str;
415 }
416
407 } // namespace 417 } // namespace
408 418
409 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; 419 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
410 420
411 base::MessageLoop* g_in_process_thread; 421 base::MessageLoop* g_in_process_thread;
412 422
413 base::MessageLoop* 423 base::MessageLoop*
414 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { 424 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() {
415 return g_in_process_thread; 425 return g_in_process_thread;
416 } 426 }
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); 1145 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled());
1136 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); 1146 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled());
1137 if (IsZeroCopyUploadEnabled()) 1147 if (IsZeroCopyUploadEnabled())
1138 command_line->AppendSwitch(switches::kEnableZeroCopy); 1148 command_line->AppendSwitch(switches::kEnableZeroCopy);
1139 if (!IsOneCopyUploadEnabled()) 1149 if (!IsOneCopyUploadEnabled())
1140 command_line->AppendSwitch(switches::kDisableOneCopy); 1150 command_line->AppendSwitch(switches::kDisableOneCopy);
1141 1151
1142 if (IsForceGpuRasterizationEnabled()) 1152 if (IsForceGpuRasterizationEnabled())
1143 command_line->AppendSwitch(switches::kForceGpuRasterization); 1153 command_line->AppendSwitch(switches::kForceGpuRasterization);
1144 1154
1145 command_line->AppendSwitchASCII( 1155 std::vector<unsigned> image_targets(
1146 switches::kContentImageTextureTarget, 1156 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D);
1147 base::UintToString( 1157 for (size_t format = 0;
1148 // TODO(reveman): We currently assume that the compositor will use 1158 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
1149 // BGRA_8888 if it's able to, and RGBA_8888 otherwise. Since we don't 1159 image_targets[format] =
1150 // know what it will use we hardcode BGRA_8888 here for now. We should 1160 BrowserGpuMemoryBufferManager::GetImageTextureTarget(
1151 // instead move decisions about GpuMemoryBuffer format to the browser 1161 static_cast<gfx::BufferFormat>(format),
1152 // embedder so we know it here, and pass that decision to the 1162 // TODO(danakj): When one-copy supports partial update, change
1153 // compositor for each usage. 1163 // this usage to PERSISTENT_MAP for one-copy.
1154 // crbug.com/490362 1164 gfx::BufferUsage::MAP);
1155 BrowserGpuMemoryBufferManager::GetImageTextureTarget( 1165 }
1156 gfx::BufferFormat::BGRA_8888, 1166 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget,
1157 // TODO(danakj): When one-copy supports partial update, change 1167 UintVectorToString(image_targets));
1158 // this usage to PERSISTENT_MAP for one-copy.
1159 gfx::BufferUsage::MAP)));
1160 1168
1161 command_line->AppendSwitchASCII( 1169 command_line->AppendSwitchASCII(
1162 switches::kVideoImageTextureTarget, 1170 switches::kVideoImageTextureTarget,
1163 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( 1171 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget(
1164 gfx::BufferFormat::R_8, gfx::BufferUsage::MAP))); 1172 gfx::BufferFormat::R_8, gfx::BufferUsage::MAP)));
1165 1173
1166 // Appending disable-gpu-feature switches due to software rendering list. 1174 // Appending disable-gpu-feature switches due to software rendering list.
1167 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 1175 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
1168 DCHECK(gpu_data_manager); 1176 DCHECK(gpu_data_manager);
1169 gpu_data_manager->AppendRendererCommandLine(command_line); 1177 gpu_data_manager->AppendRendererCommandLine(command_line);
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2518 void RenderProcessHostImpl::GetAudioOutputControllers( 2526 void RenderProcessHostImpl::GetAudioOutputControllers(
2519 const GetAudioOutputControllersCallback& callback) const { 2527 const GetAudioOutputControllersCallback& callback) const {
2520 audio_renderer_host()->GetOutputControllers(callback); 2528 audio_renderer_host()->GetOutputControllers(callback);
2521 } 2529 }
2522 2530
2523 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { 2531 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() {
2524 return bluetooth_dispatcher_host_.get(); 2532 return bluetooth_dispatcher_host_.get();
2525 } 2533 }
2526 2534
2527 } // namespace content 2535 } // namespace content
OLDNEW
« no previous file with comments | « components/html_viewer/web_layer_tree_view_impl.cc ('k') | content/renderer/gpu/compositor_dependencies.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698