forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Reland "Add support for drawImageRect-based directly composit…
…ed images"" This is a reland of 0de4d37 relanding (again) now that perf regressions are understood. There are cases where images are more frequently directly composited which leads to more memory usage. However there are Also some perf improvements, and no memory regressions on Android so we're going to reland this as-is. Original change's description: > Reland "Add support for drawImageRect-based directly composited images" > > Reland now that M83 has forked. Also adjust DCHECK in > picture_layer_impl.cc. crbug.com/1063358 points out that even if the > aspect ratio matches, we can still end up with a scaled tile that does not > exactly match the layer's bounds because of the raster scale adjustments > that kick in inside RecalculateRasterScales when the desired scale is > adjusted based on the ideal scale. > > > Original change's description: > > > Add support for drawImageRect-based directly composited images > > > > > > Directly composited images is a feature that rasterizes images at their > > > intrinsic size, when an image is the only thing drawn into a layer. > > > However, this determination is today made prior to painting the image > > > in blink, which can't be done with CompositeAfterPaint enabled. > > > > > > This CL adds support for detecting PictureLayers that qualify as directly > > > composited images, by analyzing the paint ops of the display item list. > > > If a single drawImageRect paint op is detected (with some facilities for > > > detecting images for which orientation is respected), then we'll > > > propagate the image's intrinsic size over to PictureLayerImpl on commit. > > > PictureLayerImpl then uses that information to calculate a raster scale > > > that results in the image being rasterized at its intrinsic size. > > > > > > There are a few additional changes needed outside that core calculation. > > > If the aspect ratio of the layer bounds does not match the image's > > > aspect ratio, we won't raster the image at the intrinsic size, but > > > instead will choose the scale from one dimension. In these cases, we will > > > choose to re-raster when the layer is resized until the layer bounds > > > aspect ratio matches that of the image. > > > If we do adjust the raster scale and add tilings to the active tree > > > (as is seen in the default configuration for web_tests), we should drop > > > the previous tilings (which are now non-ideal) since the max raster scale > > > tile will be chosen when the SharedQuadState is created during > > > AppendQuads. > > > We also need to tell the LayerImpl if nearest neighbor should be used > > > when the TileDrawQuad is scaled in the display compositor to preserve > > > the same output of the original drawImageRect. > > > > > > Bug: 875110 > > > > > > Change-Id: I2cda143f483c2aa30a6ae1fb850e1c7ef1227882 > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036542 > > > Reviewed-by: vmpstr <vmpstr@chromium.org> > > > Reviewed-by: Philip Rogers <pdr@chromium.org> > > > Commit-Queue: Daniel Libby <dlibby@microsoft.com> > > > Cr-Commit-Position: refs/heads/master@{#751891} > > TBR=vmpstr@chromium.org,pdr@chromium.org,dlibby@microsoft.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: 875110 > Change-Id: I485e939ba08575a3e2af5a821558e54ce6132cc2 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144398 > Reviewed-by: Daniel Libby <dlibby@microsoft.com> > Reviewed-by: Philip Rogers <pdr@chromium.org> > Reviewed-by: vmpstr <vmpstr@chromium.org> > Commit-Queue: Daniel Libby <dlibby@microsoft.com> > Cr-Commit-Position: refs/heads/master@{#758935} TBR=vmpstr@chromium.org,pdr@chromium.org Bug: 875110 Change-Id: Ide8ed7f61b045ad42862713597f2b59306e32d4f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167175 Commit-Queue: Daniel Libby <dlibby@microsoft.com> Reviewed-by: Daniel Libby <dlibby@microsoft.com> Cr-Commit-Position: refs/heads/master@{#762682}
- Loading branch information
Showing
41 changed files
with
414 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.