Chromium Code Reviews| 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() { |