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

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 2688673003: cc: Distinguish single texture mask from normal masks (Closed)
Patch Set: Rebase Created 3 years, 10 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/test/fake_picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_pixeltest_blending.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 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/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 0, 10, 10), 1437 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 0, 10, 10),
1438 non_solid_flags); 1438 non_solid_flags);
1439 recording_source->Rerecord(); 1439 recording_source->Rerecord();
1440 1440
1441 scoped_refptr<RasterSource> raster_source = 1441 scoped_refptr<RasterSource> raster_source =
1442 RasterSource::CreateFromRecordingSource(recording_source.get(), false); 1442 RasterSource::CreateFromRecordingSource(recording_source.get(), false);
1443 1443
1444 FakePictureLayerTilingClient tiling_client; 1444 FakePictureLayerTilingClient tiling_client;
1445 tiling_client.SetTileSize(size); 1445 tiling_client.SetTileSize(size);
1446 1446
1447 std::unique_ptr<PictureLayerImpl> layer_impl = 1447 std::unique_ptr<PictureLayerImpl> layer_impl = PictureLayerImpl::Create(
1448 PictureLayerImpl::Create(host_impl()->active_tree(), 1, false); 1448 host_impl()->active_tree(), 1, Layer::LayerMaskType::NOT_MASK);
1449 layer_impl->set_is_drawn_render_surface_layer_list_member(true); 1449 layer_impl->set_is_drawn_render_surface_layer_list_member(true);
1450 PictureLayerTilingSet* tiling_set = layer_impl->picture_layer_tiling_set(); 1450 PictureLayerTilingSet* tiling_set = layer_impl->picture_layer_tiling_set();
1451 1451
1452 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); 1452 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source);
1453 tiling->set_resolution(HIGH_RESOLUTION); 1453 tiling->set_resolution(HIGH_RESOLUTION);
1454 tiling->CreateAllTilesForTesting(); 1454 tiling->CreateAllTilesForTesting();
1455 tiling->SetTilePriorityRectsForTesting( 1455 tiling->SetTilePriorityRectsForTesting(
1456 gfx::Rect(layer_bounds), // Visible rect. 1456 gfx::Rect(layer_bounds), // Visible rect.
1457 gfx::Rect(layer_bounds), // Skewport rect. 1457 gfx::Rect(layer_bounds), // Skewport rect.
1458 gfx::Rect(layer_bounds), // Soon rect. 1458 gfx::Rect(layer_bounds), // Soon rect.
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 flags.setColor(SK_ColorGREEN); 1640 flags.setColor(SK_ColorGREEN);
1641 recording_source->add_draw_rect_with_flags(gfx::Rect(size), flags); 1641 recording_source->add_draw_rect_with_flags(gfx::Rect(size), flags);
1642 recording_source->add_draw_image(std::move(blue_image), gfx::Point()); 1642 recording_source->add_draw_image(std::move(blue_image), gfx::Point());
1643 recording_source->Rerecord(); 1643 recording_source->Rerecord();
1644 scoped_refptr<RasterSource> raster = 1644 scoped_refptr<RasterSource> raster =
1645 RasterSource::CreateFromRecordingSource(recording_source.get(), false); 1645 RasterSource::CreateFromRecordingSource(recording_source.get(), false);
1646 1646
1647 FakePictureLayerTilingClient tiling_client; 1647 FakePictureLayerTilingClient tiling_client;
1648 tiling_client.SetTileSize(size); 1648 tiling_client.SetTileSize(size);
1649 1649
1650 std::unique_ptr<PictureLayerImpl> layer = 1650 std::unique_ptr<PictureLayerImpl> layer = PictureLayerImpl::Create(
1651 PictureLayerImpl::Create(host_impl()->active_tree(), 1, false); 1651 host_impl()->active_tree(), 1, Layer::LayerMaskType::NOT_MASK);
1652 PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set(); 1652 PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set();
1653 layer->set_is_drawn_render_surface_layer_list_member(true); 1653 layer->set_is_drawn_render_surface_layer_list_member(true);
1654 1654
1655 auto* tiling = tiling_set->AddTiling(1.0f, raster); 1655 auto* tiling = tiling_set->AddTiling(1.0f, raster);
1656 tiling->set_resolution(resolutions[i]); 1656 tiling->set_resolution(resolutions[i]);
1657 tiling->CreateAllTilesForTesting(); 1657 tiling->CreateAllTilesForTesting();
1658 tiling->SetTilePriorityRectsForTesting( 1658 tiling->SetTilePriorityRectsForTesting(
1659 gfx::Rect(size), // Visible rect. 1659 gfx::Rect(size), // Visible rect.
1660 gfx::Rect(size), // Skewport rect. 1660 gfx::Rect(size), // Skewport rect.
1661 gfx::Rect(size), // Soon rect. 1661 gfx::Rect(size), // Soon rect.
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); })); 2258 .WillOnce(Invoke([&run_loop]() { run_loop.Quit(); }));
2259 run_loop.Run(); 2259 run_loop.Run();
2260 } 2260 }
2261 2261
2262 EXPECT_TRUE(host_impl()->tile_manager()->IsReadyToDraw()); 2262 EXPECT_TRUE(host_impl()->tile_manager()->IsReadyToDraw());
2263 EXPECT_TRUE(host_impl()->tile_manager()->IsReadyToActivate()); 2263 EXPECT_TRUE(host_impl()->tile_manager()->IsReadyToActivate());
2264 } 2264 }
2265 2265
2266 } // namespace 2266 } // namespace
2267 } // namespace cc 2267 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_pixeltest_blending.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698