Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2175553002: Raster PictureLayerTiling with fractional translation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: combined Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 11112 matching lines...) Expand 10 before | Expand all | Expand 10 after
11123 11123
11124 Region empty_invalidation; 11124 Region empty_invalidation;
11125 scoped_refptr<RasterSource> raster_source_with_tiles( 11125 scoped_refptr<RasterSource> raster_source_with_tiles(
11126 FakeRasterSource::CreateFilled(gfx::Size(10, 10))); 11126 FakeRasterSource::CreateFilled(gfx::Size(10, 10)));
11127 11127
11128 std::unique_ptr<FakePictureLayerImpl> layer = 11128 std::unique_ptr<FakePictureLayerImpl> layer =
11129 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 11); 11129 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 11);
11130 layer->SetBounds(gfx::Size(10, 10)); 11130 layer->SetBounds(gfx::Size(10, 10));
11131 layer->set_gpu_raster_max_texture_size(host_impl_->device_viewport_size()); 11131 layer->set_gpu_raster_max_texture_size(host_impl_->device_viewport_size());
11132 layer->SetDrawsContent(true); 11132 layer->SetDrawsContent(true);
11133 layer->tilings()->AddTiling(1.0f, raster_source_with_tiles); 11133 layer->tilings()->AddTiling(ScaleTranslate2d(), raster_source_with_tiles);
11134 layer->UpdateRasterSource(raster_source_with_tiles, &empty_invalidation, 11134 layer->UpdateRasterSource(raster_source_with_tiles, &empty_invalidation,
11135 nullptr); 11135 nullptr);
11136 layer->tilings()->tiling_at(0)->set_resolution( 11136 layer->tilings()->tiling_at(0)->set_resolution(
11137 TileResolution::HIGH_RESOLUTION); 11137 TileResolution::HIGH_RESOLUTION);
11138 layer->tilings()->tiling_at(0)->CreateAllTilesForTesting(); 11138 layer->tilings()->tiling_at(0)->CreateAllTilesForTesting();
11139 layer->tilings()->UpdateTilePriorities(gfx::Rect(gfx::Size(10, 10)), 1.f, 1.0, 11139 layer->tilings()->UpdateTilePriorities(gfx::Rect(gfx::Size(10, 10)), 1.f, 1.0,
11140 Occlusion(), true); 11140 Occlusion(), true);
11141 host_impl_->pending_tree()->SetRootLayerForTesting(std::move(layer)); 11141 host_impl_->pending_tree()->SetRootLayerForTesting(std::move(layer));
11142 11142
11143 FakePictureLayerImpl* root_layer = static_cast<FakePictureLayerImpl*>( 11143 FakePictureLayerImpl* root_layer = static_cast<FakePictureLayerImpl*>(
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
12094 else 12094 else
12095 EXPECT_FALSE(tile->HasRasterTask()); 12095 EXPECT_FALSE(tile->HasRasterTask());
12096 } 12096 }
12097 Region expected_invalidation( 12097 Region expected_invalidation(
12098 raster_source->GetRectForImage(checkerable_image->uniqueID())); 12098 raster_source->GetRectForImage(checkerable_image->uniqueID()));
12099 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); 12099 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation()));
12100 } 12100 }
12101 12101
12102 } // namespace 12102 } // namespace
12103 } // namespace cc 12103 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698