diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 22:04:47 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 22:04:47 +0000 |
commit | eeedf44230437227a66e852f1c5e1b83f25bede9 (patch) | |
tree | c3ae47e4d4f1783b73401eff31a6672501c0cf26 /cc/test | |
parent | 9c9e0247efce1cb09489db56f6578c840b5e6e1b (diff) | |
download | chromium_src-eeedf44230437227a66e852f1c5e1b83f25bede9.zip chromium_src-eeedf44230437227a66e852f1c5e1b83f25bede9.tar.gz chromium_src-eeedf44230437227a66e852f1c5e1b83f25bede9.tar.bz2 |
cc: Added priority ref tile set instead of sorting tiles.
This patch adds a new class PriorityRefTileSet to maintain
a priority ordering to tiles within TileManager. It sorts things
that need sorting, and doesn't sort other things. For instance,
NOW and SOON bins are sorted. EVENTUALLY and NEVER bins are not.
BUG=267151
Review URL: https://chromiumcodereview.appspot.com/21945006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/fake_picture_pile_impl.cc | 10 | ||||
-rw-r--r-- | cc/test/fake_picture_pile_impl.h | 2 | ||||
-rw-r--r-- | cc/test/fake_tile_manager.cc | 6 | ||||
-rw-r--r-- | cc/test/fake_tile_manager.h | 2 | ||||
-rw-r--r-- | cc/test/test_tile_priorities.cc | 23 | ||||
-rw-r--r-- | cc/test/test_tile_priorities.h | 34 |
6 files changed, 73 insertions, 4 deletions
diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc index 80df818..c79d0ae 100644 --- a/cc/test/fake_picture_pile_impl.cc +++ b/cc/test/fake_picture_pile_impl.cc @@ -4,6 +4,7 @@ #include "cc/test/fake_picture_pile_impl.h" +#include <limits> #include <utility> #include "cc/test/fake_rendering_stats_instrumentation.h" @@ -42,6 +43,15 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile( return pile; } +scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreatePile() { + scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl()); + gfx::Size size(std::numeric_limits<int>::max(), + std::numeric_limits<int>::max()); + pile->Resize(size); + pile->recorded_region_ = Region(gfx::Rect(size)); + return pile; +} + void FakePicturePileImpl::AddRecordingAt(int x, int y) { EXPECT_GE(x, 0); EXPECT_GE(y, 0); diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h index a606934..1b35ecfc 100644 --- a/cc/test/fake_picture_pile_impl.h +++ b/cc/test/fake_picture_pile_impl.h @@ -21,6 +21,8 @@ class FakePicturePileImpl : public PicturePileImpl { gfx::Size tile_size, gfx::Size layer_bounds); + static scoped_refptr<FakePicturePileImpl> CreatePile(); + TilingData& tiling() { return tiling_; } void AddRecordingAt(int x, int y); diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc index e302a23..c132254 100644 --- a/cc/test/fake_tile_manager.cc +++ b/cc/test/fake_tile_manager.cc @@ -42,10 +42,10 @@ FakeTileManager::~FakeTileManager() {} void FakeTileManager::AssignMemoryToTiles() { tiles_for_raster.clear(); - all_tiles.clear(); + all_tiles.Clear(); - GetSortedTilesWithAssignedBins(&all_tiles); - AssignGpuMemoryToTiles(all_tiles, &tiles_for_raster); + GetPrioritizedTileSet(&all_tiles); + AssignGpuMemoryToTiles(&all_tiles, &tiles_for_raster); } bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { diff --git a/cc/test/fake_tile_manager.h b/cc/test/fake_tile_manager.h index 77dbb78..f49c0ee 100644 --- a/cc/test/fake_tile_manager.h +++ b/cc/test/fake_tile_manager.h @@ -24,7 +24,7 @@ class FakeTileManager : public TileManager { virtual ~FakeTileManager(); std::vector<Tile*> tiles_for_raster; - std::vector<scoped_refptr<Tile> > all_tiles; + PrioritizedTileSet all_tiles; }; } // namespace cc diff --git a/cc/test/test_tile_priorities.cc b/cc/test/test_tile_priorities.cc new file mode 100644 index 0000000..f83f9b9 --- /dev/null +++ b/cc/test/test_tile_priorities.cc @@ -0,0 +1,23 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/test/test_tile_priorities.h" + +namespace cc { + +TilePriorityForSoonBin::TilePriorityForSoonBin() + : TilePriority(HIGH_RESOLUTION, 0.5, 300.0) {} + +TilePriorityForEventualBin::TilePriorityForEventualBin() + : TilePriority(NON_IDEAL_RESOLUTION, 1.0, 315.0) {} + +TilePriorityForNowBin::TilePriorityForNowBin() + : TilePriority(HIGH_RESOLUTION, 0, 0) {} + +TilePriorityRequiredForActivation::TilePriorityRequiredForActivation() + : TilePriority(HIGH_RESOLUTION, 0, 0) { + required_for_activation = true; +} + +} // namespace cc diff --git a/cc/test/test_tile_priorities.h b/cc/test/test_tile_priorities.h new file mode 100644 index 0000000..cc54105 --- /dev/null +++ b/cc/test/test_tile_priorities.h @@ -0,0 +1,34 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CC_TEST_TEST_TILE_PRIORITIES_H_ +#define CC_TEST_TEST_TILE_PRIORITIES_H_ + +#include "cc/resources/tile_priority.h" + +namespace cc { + +class TilePriorityForSoonBin : public TilePriority { + public: + TilePriorityForSoonBin(); +}; + +class TilePriorityForEventualBin : public TilePriority { + public: + TilePriorityForEventualBin(); +}; + +class TilePriorityForNowBin : public TilePriority { + public: + TilePriorityForNowBin(); +}; + +class TilePriorityRequiredForActivation : public TilePriority { + public: + TilePriorityRequiredForActivation(); +}; + +} // namespace cc + +#endif // CC_TEST_TEST_TILE_PRIORITIES_H_ |