Commit 9bdc415d authored by Ella Ge's avatar Ella Ge Committed by Commit Bot

solid color quads workaround for use-zoom-for-dsf

solid color quads used scale = 1 for non-mask layer, so when
use-zoom-for-dsf is enabled, it generates a lot more solid color
quads, which causes a bunch of rendering performance regression.

This CL makes the scale = 1 / dsf when use-zoom-for-dsf is enable,
so we generate same amount solid color quads as before.
This should not break solid color quad as it doesn't count dsf before.

Bug: 871347
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7f30ebf51fbd9bfe8800aa34f228b98985358c39
Reviewed-on: https://chromium-review.googlesource.com/1234362Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Reviewed-by: default avatarXianda Sun <sunxd@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593221}
parent 135c8748
......@@ -257,13 +257,18 @@ void PictureLayerImpl::AppendQuads(viz::RenderPass* render_pass,
if (raster_source_->IsSolidColor()) {
// TODO(sunxd): Solid color non-mask layers are forced to have contents
// scale = 1. This is a workaround to temperarily fix
// scale = 1. This is a workaround to temporary fix
// https://crbug.com/796558.
// We need to investigate into the ca layers logic and remove this
// workaround after fixing the bug.
// TODO(crbug.com/879379): Solid color non-mask layers scale divided by
// painted_device_scale_factor is a temporary fix for performance
// regression when enable --use-zoom-for-dsf. painted_device_scale_factor
// is dsf when --use-zoom-for-dsf is enabled, 1.0 otherwise, so it'll have
// no effect when the flag is disabled.
float max_contents_scale =
!(mask_type_ == Layer::LayerMaskType::MULTI_TEXTURE_MASK)
? 1
? 1 / layer_tree_impl()->painted_device_scale_factor()
: CanHaveTilings() ? ideal_contents_scale_
: std::min(kMaxIdealContentsScale,
std::max(GetIdealContentsScale(),
......
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