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

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

Issue 2895273002: Unified the use of BufferToTextureTargetMap for all the Processes (Closed)
Patch Set: Unified the use of BufferToTextureTargetMap for all the Processes Created 3 years, 6 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 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 switches::kEnableGpuMemoryBufferCompositorResources); 2015 switches::kEnableGpuMemoryBufferCompositorResources);
2016 } 2016 }
2017 2017
2018 if (IsMainFrameBeforeActivationEnabled()) 2018 if (IsMainFrameBeforeActivationEnabled())
2019 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); 2019 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation);
2020 2020
2021 if (IsCheckerImagingEnabled()) 2021 if (IsCheckerImagingEnabled())
2022 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); 2022 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging);
2023 2023
2024 cc::BufferToTextureTargetMap image_targets; 2024 cc::BufferToTextureTargetMap image_targets;
2025 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); 2025 GetBufferToTextureTargetMap(&image_targets);
danakj 2017/06/28 17:00:19 either get rid of the |image_targets| and call Get
sujith 2017/06/30 07:49:04 Done.
2026 ++usage_idx) {
2027 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
2028 for (int format_idx = 0;
2029 format_idx <= static_cast<int>(gfx::BufferFormat::LAST);
2030 ++format_idx) {
2031 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx);
2032 uint32_t target = gpu::GetImageTextureTarget(format, usage);
2033 image_targets[std::make_pair(usage, format)] = target;
2034 }
2035 }
2036 command_line->AppendSwitchASCII( 2026 command_line->AppendSwitchASCII(
2037 switches::kContentImageTextureTarget, 2027 switches::kContentImageTextureTarget,
2038 cc::BufferToTextureTargetMapToString(image_targets)); 2028 cc::BufferToTextureTargetMapToString(image_targets));
2039 2029
2040 // Appending disable-gpu-feature switches due to software rendering list. 2030 // Appending disable-gpu-feature switches due to software rendering list.
2041 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 2031 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
2042 DCHECK(gpu_data_manager); 2032 DCHECK(gpu_data_manager);
2043 gpu_data_manager->AppendRendererCommandLine(command_line); 2033 gpu_data_manager->AppendRendererCommandLine(command_line);
2044 2034
2045 // Slimming Paint v2 implies layer lists in the renderer. 2035 // Slimming Paint v2 implies layer lists in the renderer.
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3635 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3625 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3636 3626
3637 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3627 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3638 // Capture the error message in a crash key value. 3628 // Capture the error message in a crash key value.
3639 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3629 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3640 bad_message::ReceivedBadMessage(render_process_id, 3630 bad_message::ReceivedBadMessage(render_process_id,
3641 bad_message::RPH_MOJO_PROCESS_ERROR); 3631 bad_message::RPH_MOJO_PROCESS_ERROR);
3642 } 3632 }
3643 3633
3644 } // namespace content 3634 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698