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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 1896223003: Move the mapped memory limit from the compositor to the GLHelper context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-limits
Patch Set: limit-android: comment Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 6c3ed8ebd11dfa06243f67af9e037336db392bdc..9a80672078cc1bf2976f2afe3c8a1642ef108d81 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -527,6 +527,11 @@ void CompositorImpl::CreateOutputSurface() {
constexpr bool share_resources = false;
constexpr bool automatic_flushes = false;
+ constexpr size_t kBytesPerPixel = 4;
+ const size_t full_screen_texture_size_in_bytes =
+ gfx::DeviceDisplayInfo().GetDisplayHeight() *
+ gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
+
gpu::SharedMemoryLimits limits;
// This limit is meant to hold the contents of the display compositor
// drawing the scene. See discussion here:
@@ -536,16 +541,9 @@ void CompositorImpl::CreateOutputSurface() {
// any excess space.
limits.start_transfer_buffer_size = 64 * 1024;
limits.min_transfer_buffer_size = 64 * 1024;
- constexpr size_t kBytesPerPixel = 4;
- const size_t full_screen_texture_size_in_bytes =
- gfx::DeviceDisplayInfo().GetDisplayHeight() *
- gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
- limits.max_transfer_buffer_size = std::min(
- 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
- // TODO(danakj): This limit should be on the GLHelper context instead in
- // RWHVAndroid since that is where we do the async readback and map gpu
- // memory to do so.
- limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024;
+ limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes;
+ // Texture uploads may use mapped memory so give a reasonable limit for them.
+ limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes;
scoped_refptr<ContextProviderCommandBuffer> context_provider(
new ContextProviderCommandBuffer(
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698