| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "cc/playback/display_list_raster_source.h" | 10 #include "cc/playback/display_list_raster_source.h" |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 recording_source->Rerecord(); | 1474 recording_source->Rerecord(); |
| 1475 | 1475 |
| 1476 scoped_refptr<DisplayListRasterSource> raster_source = | 1476 scoped_refptr<DisplayListRasterSource> raster_source = |
| 1477 DisplayListRasterSource::CreateFromDisplayListRecordingSource( | 1477 DisplayListRasterSource::CreateFromDisplayListRecordingSource( |
| 1478 recording_source.get(), false); | 1478 recording_source.get(), false); |
| 1479 | 1479 |
| 1480 FakePictureLayerTilingClient tiling_client; | 1480 FakePictureLayerTilingClient tiling_client; |
| 1481 tiling_client.SetTileSize(size); | 1481 tiling_client.SetTileSize(size); |
| 1482 | 1482 |
| 1483 scoped_ptr<PictureLayerImpl> layer_impl = | 1483 scoped_ptr<PictureLayerImpl> layer_impl = |
| 1484 PictureLayerImpl::Create(host_impl_.active_tree(), 1, false, nullptr); | 1484 PictureLayerImpl::Create(host_impl_.active_tree(), 1, false); |
| 1485 PictureLayerTilingSet* tiling_set = layer_impl->picture_layer_tiling_set(); | 1485 PictureLayerTilingSet* tiling_set = layer_impl->picture_layer_tiling_set(); |
| 1486 | 1486 |
| 1487 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); | 1487 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); |
| 1488 tiling->set_resolution(HIGH_RESOLUTION); | 1488 tiling->set_resolution(HIGH_RESOLUTION); |
| 1489 tiling->CreateAllTilesForTesting(); | 1489 tiling->CreateAllTilesForTesting(); |
| 1490 tiling->SetTilePriorityRectsForTesting( | 1490 tiling->SetTilePriorityRectsForTesting( |
| 1491 gfx::Rect(layer_bounds), // Visible rect. | 1491 gfx::Rect(layer_bounds), // Visible rect. |
| 1492 gfx::Rect(layer_bounds), // Skewport rect. | 1492 gfx::Rect(layer_bounds), // Skewport rect. |
| 1493 gfx::Rect(layer_bounds), // Soon rect. | 1493 gfx::Rect(layer_bounds), // Soon rect. |
| 1494 gfx::Rect(layer_bounds)); // Eventually rect. | 1494 gfx::Rect(layer_bounds)); // Eventually rect. |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 recording_source->add_draw_image(blue_image.get(), gfx::Point()); | 1693 recording_source->add_draw_image(blue_image.get(), gfx::Point()); |
| 1694 recording_source->Rerecord(); | 1694 recording_source->Rerecord(); |
| 1695 scoped_refptr<DisplayListRasterSource> raster = | 1695 scoped_refptr<DisplayListRasterSource> raster = |
| 1696 DisplayListRasterSource::CreateFromDisplayListRecordingSource( | 1696 DisplayListRasterSource::CreateFromDisplayListRecordingSource( |
| 1697 recording_source.get(), false); | 1697 recording_source.get(), false); |
| 1698 | 1698 |
| 1699 FakePictureLayerTilingClient tiling_client; | 1699 FakePictureLayerTilingClient tiling_client; |
| 1700 tiling_client.SetTileSize(size); | 1700 tiling_client.SetTileSize(size); |
| 1701 | 1701 |
| 1702 scoped_ptr<PictureLayerImpl> layer = | 1702 scoped_ptr<PictureLayerImpl> layer = |
| 1703 PictureLayerImpl::Create(host_impl_->active_tree(), 1, false, nullptr); | 1703 PictureLayerImpl::Create(host_impl_->active_tree(), 1, false); |
| 1704 PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set(); | 1704 PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set(); |
| 1705 | 1705 |
| 1706 auto* tiling = tiling_set->AddTiling(1.0f, raster); | 1706 auto* tiling = tiling_set->AddTiling(1.0f, raster); |
| 1707 tiling->set_resolution(resolutions[i]); | 1707 tiling->set_resolution(resolutions[i]); |
| 1708 tiling->CreateAllTilesForTesting(); | 1708 tiling->CreateAllTilesForTesting(); |
| 1709 tiling->SetTilePriorityRectsForTesting( | 1709 tiling->SetTilePriorityRectsForTesting( |
| 1710 gfx::Rect(size), // Visible rect. | 1710 gfx::Rect(size), // Visible rect. |
| 1711 gfx::Rect(size), // Skewport rect. | 1711 gfx::Rect(size), // Skewport rect. |
| 1712 gfx::Rect(size), // Soon rect. | 1712 gfx::Rect(size), // Soon rect. |
| 1713 gfx::Rect(size)); // Eventually rect. | 1713 gfx::Rect(size)); // Eventually rect. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 | 1954 |
| 1955 // Ensures that the tile manager does not attempt to reuse tiles when partial | 1955 // Ensures that the tile manager does not attempt to reuse tiles when partial |
| 1956 // raster is disabled. | 1956 // raster is disabled. |
| 1957 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 1957 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
| 1958 RunPartialRasterCheck(std::move(host_impl_), | 1958 RunPartialRasterCheck(std::move(host_impl_), |
| 1959 false /* partial_raster_enabled */); | 1959 false /* partial_raster_enabled */); |
| 1960 } | 1960 } |
| 1961 | 1961 |
| 1962 } // namespace | 1962 } // namespace |
| 1963 } // namespace cc | 1963 } // namespace cc |
| OLD | NEW |