| Index: cc/tiles/picture_layer_tiling_unittest.cc
|
| diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc
|
| index bb4de4e6fecadca216c5fcd319c6dcc25eb186eb..631845f9a05992900f732e56fc4bfed5f36824b1 100644
|
| --- a/cc/tiles/picture_layer_tiling_unittest.cc
|
| +++ b/cc/tiles/picture_layer_tiling_unittest.cc
|
| @@ -2,12 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "cc/tiles/picture_layer_tiling.h"
|
| +
|
| #include <stddef.h>
|
|
|
| #include <limits>
|
| #include <set>
|
|
|
| #include "base/macros.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "cc/base/math_util.h"
|
| #include "cc/test/fake_output_surface.h"
|
| #include "cc/test/fake_output_surface_client.h"
|
| @@ -15,7 +18,6 @@
|
| #include "cc/test/fake_raster_source.h"
|
| #include "cc/test/test_context_provider.h"
|
| #include "cc/test/test_shared_bitmap_manager.h"
|
| -#include "cc/tiles/picture_layer_tiling.h"
|
| #include "cc/tiles/picture_layer_tiling_set.h"
|
| #include "cc/trees/layer_tree_settings.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -43,13 +45,13 @@ class TestablePictureLayerTiling : public PictureLayerTiling {
|
| using PictureLayerTiling::SetLiveTilesRect;
|
| using PictureLayerTiling::TileAt;
|
|
|
| - static scoped_ptr<TestablePictureLayerTiling> Create(
|
| + static std::unique_ptr<TestablePictureLayerTiling> Create(
|
| WhichTree tree,
|
| float contents_scale,
|
| scoped_refptr<RasterSource> raster_source,
|
| PictureLayerTilingClient* client,
|
| const LayerTreeSettings& settings) {
|
| - return make_scoped_ptr(new TestablePictureLayerTiling(
|
| + return base::WrapUnique(new TestablePictureLayerTiling(
|
| tree, contents_scale, raster_source, client,
|
| settings.tiling_interest_area_padding,
|
| settings.skewport_target_time_in_seconds,
|
| @@ -197,7 +199,7 @@ class PictureLayerTilingIteratorTest : public testing::Test {
|
|
|
| protected:
|
| FakePictureLayerTilingClient client_;
|
| - scoped_ptr<TestablePictureLayerTiling> tiling_;
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling_;
|
|
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingIteratorTest);
|
| @@ -583,7 +585,7 @@ TEST(PictureLayerTilingTest, SkewportLimits) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, settings);
|
|
|
| @@ -667,7 +669,7 @@ TEST(PictureLayerTilingTest, ComputeSkewportExtremeCases) {
|
| LayerTreeSettings settings;
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, settings);
|
|
|
| @@ -700,7 +702,7 @@ TEST(PictureLayerTilingTest, ComputeSkewport) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
|
|
| @@ -762,7 +764,7 @@ TEST(PictureLayerTilingTest, SkewportThroughUpdateTilePriorities) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
|
|
| @@ -836,7 +838,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
|
| // tiling.
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 0.25f, raster_source,
|
| &client, settings);
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1146,7 +1148,7 @@ TEST(ComputeTilePriorityRectsTest, VisibleTiles) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1201,7 +1203,7 @@ TEST(ComputeTilePriorityRectsTest, OffscreenTiles) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1266,7 +1268,7 @@ TEST(ComputeTilePriorityRectsTest, PartiallyOffscreenLayer) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1325,7 +1327,7 @@ TEST(ComputeTilePriorityRectsTest, PartiallyOffscreenRotatedLayer) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1409,7 +1411,7 @@ TEST(ComputeTilePriorityRectsTest, PerspectiveLayer) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1503,7 +1505,7 @@ TEST(ComputeTilePriorityRectsTest, PerspectiveLayerClippedByW) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, LayerTreeSettings());
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1567,7 +1569,7 @@ TEST(ComputeTilePriorityRectsTest, BasicMotion) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(current_layer_bounds);
|
| - scoped_ptr<TestablePictureLayerTiling> tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &client, settings);
|
| tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1613,7 +1615,7 @@ TEST(ComputeTilePriorityRectsTest, RotationMotion) {
|
| // layer space and screen space.
|
|
|
| FakePictureLayerTilingClient client;
|
| - scoped_ptr<TestablePictureLayerTiling> tiling;
|
| + std::unique_ptr<TestablePictureLayerTiling> tiling;
|
|
|
| gfx::Size device_viewport(800, 600);
|
| gfx::Rect visible_layer_rect(0, 0, 0, 0); // offscren.
|
| @@ -1696,7 +1698,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(gfx::Size(10000, 10000));
|
| - scoped_ptr<TestablePictureLayerTiling> active_tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> active_tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &active_client, settings);
|
| active_tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1709,7 +1711,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) {
|
| recycle_client.set_twin_tiling(active_tiling.get());
|
|
|
| raster_source = FakeRasterSource::CreateFilled(gfx::Size(10000, 10000));
|
| - scoped_ptr<TestablePictureLayerTiling> recycle_tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> recycle_tiling =
|
| TestablePictureLayerTiling::Create(PENDING_TREE, 1.0f, raster_source,
|
| &recycle_client, settings);
|
| recycle_tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1747,7 +1749,7 @@ TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(gfx::Size(100, 100));
|
| - scoped_ptr<TestablePictureLayerTiling> active_tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> active_tiling =
|
| TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.0f, raster_source,
|
| &active_client, LayerTreeSettings());
|
| active_tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1762,7 +1764,7 @@ TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) {
|
| LayerTreeSettings settings;
|
|
|
| raster_source = FakeRasterSource::CreateFilled(gfx::Size(100, 100));
|
| - scoped_ptr<TestablePictureLayerTiling> recycle_tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> recycle_tiling =
|
| TestablePictureLayerTiling::Create(PENDING_TREE, 1.0f, raster_source,
|
| &recycle_client, settings);
|
| recycle_tiling->set_resolution(HIGH_RESOLUTION);
|
| @@ -1790,7 +1792,7 @@ TEST(PictureLayerTilingTest, InvalidateAfterComputeTilePriorityRects) {
|
|
|
| scoped_refptr<FakeRasterSource> raster_source =
|
| FakeRasterSource::CreateFilled(gfx::Size(100, 100));
|
| - scoped_ptr<TestablePictureLayerTiling> pending_tiling =
|
| + std::unique_ptr<TestablePictureLayerTiling> pending_tiling =
|
| TestablePictureLayerTiling::Create(PENDING_TREE, 1.0f, raster_source,
|
| &pending_client, LayerTreeSettings());
|
| pending_tiling->set_resolution(HIGH_RESOLUTION);
|
|
|