Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index 852e94e1c8b4f396f31692c1ee66f72f20195141..5af3bb0b0a3e0f65550e425ccc66dd0efe7ca0ac 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -14,6 +14,7 @@ |
#include "base/metrics/histogram.h" |
#include "base/stl_util.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "base/sys_utils.h" |
#include "build/build_config.h" |
#include "cc/base/switches.h" |
#include "cc/debug/benchmark_instrumentation.h" |
@@ -67,7 +68,6 @@ |
#include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h" |
#if defined(OS_ANDROID) |
-#include "base/android/sys_utils.h" |
#include "content/renderer/android/synchronous_compositor_factory.h" |
#endif |
@@ -932,10 +932,8 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) { |
if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) { |
DCHECK(is_threaded_compositing_enabled_); |
cc::ResourceFormat format = cc::RGBA_8888; |
-#if defined(OS_ANDROID) |
- if (base::android::SysUtils::IsLowEndDevice()) |
+ if (base::SysUtils::IsLowEndDevice()) |
format = cc::RGB_565; |
-#endif |
return scoped_ptr<cc::OutputSurface>( |
new MailboxOutputSurface( |
routing_id(), |
@@ -2834,14 +2832,14 @@ RenderWidget::CreateGraphicsContext3D( |
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
-#if defined(OS_ANDROID) |
+ |
// If we raster too fast we become upload bound, and pending |
// uploads consume memory. For maximum upload throughput, we would |
// want to allow for upload_throughput * pipeline_time of pending |
// uploads, after which we are just wasting memory. Since we don't |
// know our upload throughput yet, this just caps our memory usage. |
size_t divider = 1; |
- if (base::android::SysUtils::IsLowEndDevice()) |
+ if (base::SysUtils::IsLowEndDevice()) |
divider = 6; |
// For reference Nexus10 can upload 1MB in about 2.5ms. |
const double max_mb_uploaded_per_ms = 2.0 / (5 * divider); |
@@ -2855,7 +2853,6 @@ RenderWidget::CreateGraphicsContext3D( |
// to avoid unnecessarily stalling the compositor thread. |
limits.mapped_memory_reclaim_limit = |
max_transfer_buffer_usage_mb * kBytesPerMegabyte; |
piman
2014/01/08 04:41:50
This changes behavior for non-low-end devices too.
ostap
2014/01/20 08:12:24
Done.
|
-#endif |
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
new WebGraphicsContext3DCommandBufferImpl( |