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

Side by Side Diff: content/renderer/render_widget.cc

Issue 1969163002: Give the media context small memory limits (same as compositor). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: limitsmedia: . Created 4 years, 7 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 (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 #include "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 frame_swap_message_queue_)); 754 frame_swap_message_queue_));
755 } 755 }
756 756
757 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider = 757 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider =
758 RenderThreadImpl::current()->SharedCompositorWorkerContextProvider(); 758 RenderThreadImpl::current()->SharedCompositorWorkerContextProvider();
759 if (!worker_context_provider) { 759 if (!worker_context_provider) {
760 // Cause the compositor to wait and try again. 760 // Cause the compositor to wait and try again.
761 return nullptr; 761 return nullptr;
762 } 762 }
763 763
764 gpu::SharedMemoryLimits limits;
765 // The renderer compositor context doesn't do a lot of stuff, so we don't 764 // The renderer compositor context doesn't do a lot of stuff, so we don't
766 // expect it to need a lot of space for commands or transfer. Raster and 765 // expect it to need a lot of space for commands or transfer. Raster and
767 // uploads happen on the worker context instead. 766 // uploads happen on the worker context instead.
768 limits.command_buffer_size = 64 * 1024; 767 gpu::SharedMemoryLimits limits = gpu::SharedMemoryLimits::ForMailboxContext();
769 limits.start_transfer_buffer_size = 64 * 1024;
770 limits.min_transfer_buffer_size = 64 * 1024;
771 768
772 // This is for an offscreen context for the compositor. So the default 769 // This is for an offscreen context for the compositor. So the default
773 // framebuffer doesn't need alpha, depth, stencil, antialiasing. 770 // framebuffer doesn't need alpha, depth, stencil, antialiasing.
774 gpu::gles2::ContextCreationAttribHelper attributes; 771 gpu::gles2::ContextCreationAttribHelper attributes;
775 attributes.alpha_size = -1; 772 attributes.alpha_size = -1;
776 attributes.depth_size = 0; 773 attributes.depth_size = 0;
777 attributes.stencil_size = 0; 774 attributes.stencil_size = 0;
778 attributes.samples = 0; 775 attributes.samples = 0;
779 attributes.sample_buffers = 0; 776 attributes.sample_buffers = 0;
780 attributes.bind_generates_resource = false; 777 attributes.bind_generates_resource = false;
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 } 2084 }
2088 2085
2089 float RenderWidget::GetOriginalDeviceScaleFactor() const { 2086 float RenderWidget::GetOriginalDeviceScaleFactor() const {
2090 return 2087 return
2091 screen_metrics_emulator_ ? 2088 screen_metrics_emulator_ ?
2092 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : 2089 screen_metrics_emulator_->original_screen_info().deviceScaleFactor :
2093 device_scale_factor_; 2090 device_scale_factor_;
2094 } 2091 }
2095 2092
2096 } // namespace content 2093 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | gpu/command_buffer/client/shared_memory_limits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698