Commit c75f97ab authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Chromium LUCI CQ

[Fuchsia] Disable direct image compositing on low-end devices

Direct image compositing causes excessive memory usage. This change
disabled the feature on low-end devices to save memory. Currently
it's limited to OS_FUCHSIA to disable potential performance impact on
other platforms.

Bug: 1161327
Change-Id: I709895c6564aba79cfeb762e8fd6d698bde7795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601638Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842290}
parent 5f67f894
......@@ -17,6 +17,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/numerics/ranges.h"
#include "base/system/sys_info.h"
#include "base/time/time.h"
#include "base/trace_event/traced_value.h"
#include "build/build_config.h"
......@@ -1112,6 +1113,15 @@ bool PictureLayerImpl::ShouldDirectlyCompositeImage(float raster_scale) const {
if (raster_scale < 0.1f)
return true;
#if defined(OS_FUCHSIA)
// Always downscale images on low-end devices to save memory. This is a
// temporary fix to work around crbug.com/1161327 .
// TODO(crbug.com/1161327): Implement proper solution that works on all
// devices.
if (base::SysInfo::IsLowEndDevice() && raster_scale > 1.0)
return false;
#endif // defined(OS_FUCHSIA)
// If the results of scaling the bounds by the expected raster scale
// would end up with a content rect whose width/height are more than one
// pixel different from the layer bounds, don't directly composite the image
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment