diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 05:46:33 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 05:46:33 +0000 |
commit | 62b6fdb8d49e80c053fc6dd38548b933ba668e83 (patch) | |
tree | 0c993df7d943ab20d5a7c28f46481dec95381ff5 /cc/test/fake_picture_layer_tiling_client.cc | |
parent | e34c0be97a60b56390e598ca34a1da7e81a8b2a7 (diff) | |
download | chromium_src-62b6fdb8d49e80c053fc6dd38548b933ba668e83.zip chromium_src-62b6fdb8d49e80c053fc6dd38548b933ba668e83.tar.gz chromium_src-62b6fdb8d49e80c053fc6dd38548b933ba668e83.tar.bz2 |
cc: Replace recorded region with direct map lookup
If the viewport is extremely large, then keeping track of the recorded
region in PicturePile with an actual Region becomes extremely slow due
to a large number of rects being inserted into it.
The recorded region behaves as a cache to the picture map; it's a
simpler way to know the state of all of the recordings contained within.
In practice, the recorded region is only used for two things: a "should
this pile bother to create tilings" optimization and a "can a tile be
rastered in this content rect" check aka CanRaster.
The optimization for "should create tilings" is replaced by a
has_any_recordings_ boolean, which could have a false positive in theory
(resizing to a smaller but non-empty size), but which shouldn't happen
in practice. Even if it did, this would only be a performance penalty
for creating no-op tilings that can't create tiles (due to CanRaster).
The CanRaster check is replaced by a viewport hint, as most tiles that
the tiling creates will be inside of the very large expanded viewport
during recording, turning an expensive Region.Contains check to a
Rect.Contains one. In the edge cases where tiles are being created
outside of that expanded viewport, it will check the picture map
directly. This should only happen when the user has scrolled thousands
of pixels without a commit.
BUG=353346
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256953
Review URL: https://codereview.chromium.org/196343005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_picture_layer_tiling_client.cc')
-rw-r--r-- | cc/test/fake_picture_layer_tiling_client.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/cc/test/fake_picture_layer_tiling_client.cc b/cc/test/fake_picture_layer_tiling_client.cc index 36d1eee..4289b9d4 100644 --- a/cc/test/fake_picture_layer_tiling_client.cc +++ b/cc/test/fake_picture_layer_tiling_client.cc @@ -6,26 +6,14 @@ #include <limits> +#include "cc/test/fake_picture_pile_impl.h" #include "cc/test/fake_tile_manager.h" namespace cc { -class FakeInfinitePicturePileImpl : public PicturePileImpl { - public: - FakeInfinitePicturePileImpl() { - gfx::Size size(std::numeric_limits<int>::max(), - std::numeric_limits<int>::max()); - Resize(size); - recorded_region_ = Region(gfx::Rect(size)); - } - - protected: - virtual ~FakeInfinitePicturePileImpl() {} -}; - FakePictureLayerTilingClient::FakePictureLayerTilingClient() : tile_manager_(new FakeTileManager(&tile_manager_client_)), - pile_(new FakeInfinitePicturePileImpl()), + pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), twin_tiling_(NULL), allow_create_tile_(true), max_tiles_for_interest_area_(10000), @@ -36,7 +24,7 @@ FakePictureLayerTilingClient::FakePictureLayerTilingClient( ResourceProvider* resource_provider) : tile_manager_( new FakeTileManager(&tile_manager_client_, resource_provider)), - pile_(new FakeInfinitePicturePileImpl()), + pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), twin_tiling_(NULL), allow_create_tile_(true), max_tiles_for_interest_area_(10000), |