cc: Replace empty tile size with max content scale for mask layers.
commitf1543da5801d15bbc6cf5ea03cc5c27b3565e906
authordanakj <danakj@chromium.org>
Thu, 18 Dec 2014 21:26:19 +0000 (18 13:26 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Dec 2014 21:26:41 +0000 (18 21:26 +0000)
tree13fee858568bf7fdb2a70b200f0c7e1af885c049
parent936440ef9d5f20240add45de0712b816b46da647
cc: Replace empty tile size with max content scale for mask layers.

Mask layers use a single tile, so the content bounds of a tiling can't
exceed the max_texture_size for the current renderer.

Previously we always created a tiling at the ideal scale and then just
didn't put a tile in it if the tiling was too big (by returning an empty
size from PictureLayerImpl::CalculateTileSize).

Instead, introduce a MaximumContentsScale() similar to the
MinimumContentsScale() on PictureLayerImpl, which is used for mask
layers to ensure a tiling is not made at a scale larger than is ok for
the max_texture_size. And if no tiling is possible then CanHaveTilings()
is false and the layer has no tilings.

This changes the behaviour for mask layers that are huge (like > 100k
pixels tall/wide), in that instead of the mask just completely
disappearing, it's scale will downgrade making the mask become less sharp
instead.

Also removes the SyncTilings(ForTesting) method from
PictureLayerTilingSet and the tests for it, replacing them with better
tests for the new non-syncing-tilings world.

R=enne, vmpstr
BUG=387116

Review URL: https://codereview.chromium.org/819433002

Cr-Commit-Position: refs/heads/master@{#309076}
cc/layers/picture_layer_impl.cc
cc/layers/picture_layer_impl.h
cc/layers/picture_layer_impl_unittest.cc
cc/resources/picture_layer_tiling.cc
cc/resources/picture_layer_tiling_set.cc
cc/resources/picture_layer_tiling_set.h
cc/resources/picture_layer_tiling_set_unittest.cc
cc/resources/picture_layer_tiling_unittest.cc
cc/test/fake_picture_layer_tiling_client.cc
cc/test/fake_picture_layer_tiling_client.h