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

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

Issue 2646643002: android: Tweak readback context memory limits (Closed)
Patch Set: semicolon Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index f9d85b75db2c102fb3391dd44668741a26ffe51c..3f4ba3063197b36923d40c2e4835fbaa075cab40 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -196,22 +196,9 @@ void GLHelperHolder::Initialize() {
// reasonable but small limit.
limits.start_transfer_buffer_size = 4 * 1024;
limits.min_transfer_buffer_size = 4 * 1024;
-
- // Use the largest available display size as the max texture size.
- constexpr size_t kBytesPerPixel = 4;
- size_t max_screen_texture_size_in_bytes = limits.min_transfer_buffer_size;
- for (auto& display : display::Screen::GetScreen()->GetAllDisplays()) {
- gfx::Size size = display.GetSizeInPixel();
- size_t display_size_in_bytes =
- kBytesPerPixel * size.width() * size.height();
- if (display_size_in_bytes > max_screen_texture_size_in_bytes)
- max_screen_texture_size_in_bytes = display_size_in_bytes;
- }
-
- limits.max_transfer_buffer_size = max_screen_texture_size_in_bytes;
- // This context is used for doing async readbacks, so allow at least a full
- // screen readback to be mapped.
- limits.mapped_memory_reclaim_limit = max_screen_texture_size_in_bytes;
+ limits.max_transfer_buffer_size = 128 * 1024;
+ // Very few allocations from mapped memory pool, so this can be really low.
+ limits.mapped_memory_reclaim_limit = 4 * 1024;
constexpr bool automatic_flushes = false;
constexpr bool support_locking = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698