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

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

Issue 17294003: Tune helper context buffer sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/image_transport_factory_android.cc
diff --git a/content/browser/renderer_host/image_transport_factory_android.cc b/content/browser/renderer_host/image_transport_factory_android.cc
index 9703f85f4d0690c28541ac050a0a910bf1b020a1..b366e1ed91f4028b048c6d765f19076bf1342e42 100644
--- a/content/browser/renderer_host/image_transport_factory_android.cc
+++ b/content/browser/renderer_host/image_transport_factory_android.cc
@@ -12,6 +12,7 @@
#include "content/common/gpu/gpu_process_launch_causes.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/khronos/GLES2/gl2.h"
+#include "ui/gfx/android/device_display_info.h"
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
namespace content {
@@ -96,10 +97,22 @@ CmdBufferImageTransportFactory::CmdBufferImageTransportFactory() {
url,
factory,
swap_client));
- context_->InitializeWithDefaultBufferSizes(
+ static size_t kBitsPerByte = 8;
no sievers 2013/06/17 19:06:35 nit: const
kaanb 2013/06/18 11:20:03 Done.
+ gfx::DeviceDisplayInfo display_info;
+ size_t full_screen_texture_size_in_bytes =
+ display_info.GetDisplayHeight() *
+ display_info.GetDisplayWidth() *
+ display_info.GetBitsPerPixel() / kBitsPerByte;
no sievers 2013/06/17 19:06:35 I don't think we need to look at the display bpp h
kaanb 2013/06/18 11:20:03 Done.
+ context_->Initialize(
attrs,
false,
- CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE);
+ CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE,
+ 64 * 1024, // command buffer size
+ std::min(full_screen_texture_size_in_bytes,
+ kDefaultStartTransferBufferSize),
+ kDefaultMinTransferBufferSize,
+ std::min(3 * full_screen_texture_size_in_bytes,
+ kDefaultMaxTransferBufferSize));
no sievers 2013/06/17 19:06:35 These values seem to not cap anything if you assum
kaanb 2013/06/18 11:20:03 Yes, we're not capping the starting size but we're
}
CmdBufferImageTransportFactory::~CmdBufferImageTransportFactory() {
« no previous file with comments | « no previous file | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698