OLD | NEW |
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/layers/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
6 | 6 |
7 #include "cc/debug/overdraw_metrics.h" | 7 #include "cc/debug/overdraw_metrics.h" |
8 #include "cc/resources/bitmap_content_layer_updater.h" | 8 #include "cc/resources/bitmap_content_layer_updater.h" |
9 #include "cc/resources/layer_painter.h" | 9 #include "cc/resources/layer_painter.h" |
10 #include "cc/resources/prioritized_resource_manager.h" | 10 #include "cc/resources/prioritized_resource_manager.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 583 |
584 resource_manager_->SetMaxMemoryLimitBytes(memory_for_layer); | 584 resource_manager_->SetMaxMemoryLimitBytes(memory_for_layer); |
585 | 585 |
586 scoped_refptr<FakeTiledLayer> layer = | 586 scoped_refptr<FakeTiledLayer> layer = |
587 make_scoped_refptr(new FakeTiledLayer(resource_manager_.get())); | 587 make_scoped_refptr(new FakeTiledLayer(resource_manager_.get())); |
588 scoped_ptr<FakeTiledLayerImpl> layer_impl = | 588 scoped_ptr<FakeTiledLayerImpl> layer_impl = |
589 make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); | 589 make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1)); |
590 | 590 |
591 // Full size layer with half being visible. | 591 // Full size layer with half being visible. |
592 layer->SetBounds(gfx::Size(layer_width, layer_height)); | 592 layer->SetBounds(gfx::Size(layer_width, layer_height)); |
593 gfx::Rect visible_rect(gfx::Point(), | 593 gfx::Rect visible_rect(0, 0, layer_width / 2, layer_height); |
594 gfx::Size(layer_width / 2, layer_height)); | |
595 CalcDrawProps(layer); | 594 CalcDrawProps(layer); |
596 | 595 |
597 // Pretend the layer is animating. | 596 // Pretend the layer is animating. |
598 layer->draw_properties().target_space_transform_is_animating = true; | 597 layer->draw_properties().target_space_transform_is_animating = true; |
599 layer->draw_properties().visible_content_rect = visible_rect; | 598 layer->draw_properties().visible_content_rect = visible_rect; |
600 layer->SetLayerTreeHost(layer_tree_host_.get()); | 599 layer->SetLayerTreeHost(layer_tree_host_.get()); |
601 | 600 |
602 // The layer should paint its entire contents on the first paint | 601 // The layer should paint its entire contents on the first paint |
603 // if it is close to the viewport size and has the available memory. | 602 // if it is close to the viewport size and has the available memory. |
604 layer->SetTexturePriorities(priority_calculator_); | 603 layer->SetTexturePriorities(priority_calculator_); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 LayerPushPropertiesTo(layer.get(), layer_impl.get()); | 848 LayerPushPropertiesTo(layer.get(), layer_impl.get()); |
850 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(0, 0)); | 849 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(0, 0)); |
851 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(0, 1)); | 850 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(0, 1)); |
852 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(1, 0)); | 851 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(1, 0)); |
853 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(1, 1)); | 852 EXPECT_FALSE(layer_impl->HasResourceIdForTileAt(1, 1)); |
854 } | 853 } |
855 | 854 |
856 TEST_F(TiledLayerTest, SkipsDrawGetsReset) { | 855 TEST_F(TiledLayerTest, SkipsDrawGetsReset) { |
857 // Create two 300 x 300 tiled layers. | 856 // Create two 300 x 300 tiled layers. |
858 gfx::Size content_bounds(300, 300); | 857 gfx::Size content_bounds(300, 300); |
859 gfx::Rect content_rect(gfx::Point(), content_bounds); | 858 gfx::Rect content_rect(content_bounds); |
860 | 859 |
861 // We have enough memory for only one of the two layers. | 860 // We have enough memory for only one of the two layers. |
862 int memory_limit = 4 * 300 * 300; // 4 bytes per pixel. | 861 int memory_limit = 4 * 300 * 300; // 4 bytes per pixel. |
863 | 862 |
864 scoped_refptr<FakeTiledLayer> root_layer = make_scoped_refptr( | 863 scoped_refptr<FakeTiledLayer> root_layer = make_scoped_refptr( |
865 new FakeTiledLayer(layer_tree_host_->contents_texture_manager())); | 864 new FakeTiledLayer(layer_tree_host_->contents_texture_manager())); |
866 scoped_refptr<FakeTiledLayer> child_layer = make_scoped_refptr( | 865 scoped_refptr<FakeTiledLayer> child_layer = make_scoped_refptr( |
867 new FakeTiledLayer(layer_tree_host_->contents_texture_manager())); | 866 new FakeTiledLayer(layer_tree_host_->contents_texture_manager())); |
868 root_layer->AddChild(child_layer); | 867 root_layer->AddChild(child_layer); |
869 | 868 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 } | 929 } |
931 | 930 |
932 class TiledLayerPartialUpdateTest : public TiledLayerTest { | 931 class TiledLayerPartialUpdateTest : public TiledLayerTest { |
933 public: | 932 public: |
934 TiledLayerPartialUpdateTest() { settings_.max_partial_texture_updates = 4; } | 933 TiledLayerPartialUpdateTest() { settings_.max_partial_texture_updates = 4; } |
935 }; | 934 }; |
936 | 935 |
937 TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { | 936 TEST_F(TiledLayerPartialUpdateTest, PartialUpdates) { |
938 // Create one 300 x 200 tiled layer with 3 x 2 tiles. | 937 // Create one 300 x 200 tiled layer with 3 x 2 tiles. |
939 gfx::Size content_bounds(300, 200); | 938 gfx::Size content_bounds(300, 200); |
940 gfx::Rect content_rect(gfx::Point(), content_bounds); | 939 gfx::Rect content_rect(content_bounds); |
941 | 940 |
942 scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr( | 941 scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr( |
943 new FakeTiledLayer(layer_tree_host_->contents_texture_manager())); | 942 new FakeTiledLayer(layer_tree_host_->contents_texture_manager())); |
944 layer->SetBounds(content_bounds); | 943 layer->SetBounds(content_bounds); |
945 layer->SetPosition(gfx::PointF(0, 0)); | 944 layer->SetPosition(gfx::PointF(0, 0)); |
946 layer->draw_properties().visible_content_rect = content_rect; | 945 layer->draw_properties().visible_content_rect = content_rect; |
947 layer->InvalidateContentRect(content_rect); | 946 layer->InvalidateContentRect(content_rect); |
948 | 947 |
949 layer_tree_host_->SetRootLayer(layer); | 948 layer_tree_host_->SetRootLayer(layer); |
950 layer_tree_host_->SetViewportSize(gfx::Size(300, 200), gfx::Size(300, 200)); | 949 layer_tree_host_->SetViewportSize(gfx::Size(300, 200), gfx::Size(300, 200)); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 occlusion_ = &occluded; | 1067 occlusion_ = &occluded; |
1069 | 1068 |
1070 // The tile size is 100x100. | 1069 // The tile size is 100x100. |
1071 | 1070 |
1072 layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); | 1071 layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); |
1073 layer->SetBounds(gfx::Size(600, 600)); | 1072 layer->SetBounds(gfx::Size(600, 600)); |
1074 CalcDrawProps(layer); | 1073 CalcDrawProps(layer); |
1075 | 1074 |
1076 occluded.SetOcclusion(gfx::Rect(200, 200, 300, 100)); | 1075 occluded.SetOcclusion(gfx::Rect(200, 200, 300, 100)); |
1077 layer->draw_properties().drawable_content_rect = | 1076 layer->draw_properties().drawable_content_rect = |
1078 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1077 gfx::Rect(layer->content_bounds()); |
1079 layer->draw_properties().visible_content_rect = | 1078 layer->draw_properties().visible_content_rect = |
1080 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1079 gfx::Rect(layer->content_bounds()); |
1081 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); | 1080 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); |
1082 | 1081 |
1083 layer->SetTexturePriorities(priority_calculator_); | 1082 layer->SetTexturePriorities(priority_calculator_); |
1084 resource_manager_->PrioritizeTextures(); | 1083 resource_manager_->PrioritizeTextures(); |
1085 layer->Update(queue_.get(), &occluded, NULL); | 1084 layer->Update(queue_.get(), &occluded, NULL); |
1086 EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); | 1085 EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); |
1087 | 1086 |
1088 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); | 1087 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); |
1089 EXPECT_NEAR( | 1088 EXPECT_NEAR( |
1090 occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); | 1089 occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); | 1244 layer_tree_host_->SetViewportSize(gfx::Size(600, 600), gfx::Size(600, 600)); |
1246 layer->SetBounds(gfx::Size(600, 600)); | 1245 layer->SetBounds(gfx::Size(600, 600)); |
1247 CalcDrawProps(layer); | 1246 CalcDrawProps(layer); |
1248 gfx::Transform screen_transform; | 1247 gfx::Transform screen_transform; |
1249 screen_transform.Scale(0.5, 0.5); | 1248 screen_transform.Scale(0.5, 0.5); |
1250 layer->draw_properties().screen_space_transform = screen_transform; | 1249 layer->draw_properties().screen_space_transform = screen_transform; |
1251 layer->draw_properties().target_space_transform = screen_transform; | 1250 layer->draw_properties().target_space_transform = screen_transform; |
1252 | 1251 |
1253 occluded.SetOcclusion(gfx::Rect(100, 100, 150, 50)); | 1252 occluded.SetOcclusion(gfx::Rect(100, 100, 150, 50)); |
1254 layer->draw_properties().drawable_content_rect = | 1253 layer->draw_properties().drawable_content_rect = |
1255 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1254 gfx::Rect(layer->content_bounds()); |
1256 layer->draw_properties().visible_content_rect = | 1255 layer->draw_properties().visible_content_rect = |
1257 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1256 gfx::Rect(layer->content_bounds()); |
1258 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); | 1257 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); |
1259 layer->SetTexturePriorities(priority_calculator_); | 1258 layer->SetTexturePriorities(priority_calculator_); |
1260 resource_manager_->PrioritizeTextures(); | 1259 resource_manager_->PrioritizeTextures(); |
1261 layer->Update(queue_.get(), &occluded, NULL); | 1260 layer->Update(queue_.get(), &occluded, NULL); |
1262 EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); | 1261 EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); |
1263 | 1262 |
1264 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); | 1263 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); |
1265 EXPECT_NEAR( | 1264 EXPECT_NEAR( |
1266 occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); | 1265 occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); |
1267 EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); | 1266 EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); |
(...skipping 16 matching lines...) Expand all Loading... |
1284 CalcDrawProps(layer); | 1283 CalcDrawProps(layer); |
1285 EXPECT_FLOAT_EQ(layer->contents_scale_x(), layer->contents_scale_y()); | 1284 EXPECT_FLOAT_EQ(layer->contents_scale_x(), layer->contents_scale_y()); |
1286 gfx::Transform draw_transform; | 1285 gfx::Transform draw_transform; |
1287 double inv_scale_factor = 1 / layer->contents_scale_x(); | 1286 double inv_scale_factor = 1 / layer->contents_scale_x(); |
1288 draw_transform.Scale(inv_scale_factor, inv_scale_factor); | 1287 draw_transform.Scale(inv_scale_factor, inv_scale_factor); |
1289 layer->draw_properties().target_space_transform = draw_transform; | 1288 layer->draw_properties().target_space_transform = draw_transform; |
1290 layer->draw_properties().screen_space_transform = draw_transform; | 1289 layer->draw_properties().screen_space_transform = draw_transform; |
1291 | 1290 |
1292 occluded.SetOcclusion(gfx::Rect(200, 200, 300, 100)); | 1291 occluded.SetOcclusion(gfx::Rect(200, 200, 300, 100)); |
1293 layer->draw_properties().drawable_content_rect = | 1292 layer->draw_properties().drawable_content_rect = |
1294 gfx::Rect(gfx::Point(), layer->bounds()); | 1293 gfx::Rect(layer->bounds()); |
1295 layer->draw_properties().visible_content_rect = | 1294 layer->draw_properties().visible_content_rect = |
1296 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1295 gfx::Rect(layer->content_bounds()); |
1297 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); | 1296 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); |
1298 layer->SetTexturePriorities(priority_calculator_); | 1297 layer->SetTexturePriorities(priority_calculator_); |
1299 resource_manager_->PrioritizeTextures(); | 1298 resource_manager_->PrioritizeTextures(); |
1300 layer->Update(queue_.get(), &occluded, NULL); | 1299 layer->Update(queue_.get(), &occluded, NULL); |
1301 // The content is half the size of the layer (so the number of tiles is | 1300 // The content is half the size of the layer (so the number of tiles is |
1302 // fewer). In this case, the content is 300x300, and since the tile size is | 1301 // fewer). In this case, the content is 300x300, and since the tile size is |
1303 // 100, the number of tiles 3x3. | 1302 // 100, the number of tiles 3x3. |
1304 EXPECT_EQ(9, layer->fake_layer_updater()->update_count()); | 1303 EXPECT_EQ(9, layer->fake_layer_updater()->update_count()); |
1305 | 1304 |
1306 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); | 1305 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); |
1307 EXPECT_NEAR( | 1306 EXPECT_NEAR( |
1308 occluded.overdraw_metrics()->pixels_uploaded_translucent(), 90000, 1); | 1307 occluded.overdraw_metrics()->pixels_uploaded_translucent(), 90000, 1); |
1309 EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); | 1308 EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); |
1310 | 1309 |
1311 layer->fake_layer_updater()->ClearUpdateCount(); | 1310 layer->fake_layer_updater()->ClearUpdateCount(); |
1312 | 1311 |
1313 // This makes sure the painting works when the content space is scaled to | 1312 // This makes sure the painting works when the content space is scaled to |
1314 // a different layer space. In this case the occluded region catches the | 1313 // a different layer space. In this case the occluded region catches the |
1315 // blown up tiles. | 1314 // blown up tiles. |
1316 occluded.SetOcclusion(gfx::Rect(200, 200, 300, 200)); | 1315 occluded.SetOcclusion(gfx::Rect(200, 200, 300, 200)); |
1317 layer->draw_properties().drawable_content_rect = | 1316 layer->draw_properties().drawable_content_rect = |
1318 gfx::Rect(gfx::Point(), layer->bounds()); | 1317 gfx::Rect(layer->bounds()); |
1319 layer->draw_properties().visible_content_rect = | 1318 layer->draw_properties().visible_content_rect = |
1320 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1319 gfx::Rect(layer->content_bounds()); |
1321 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); | 1320 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); |
1322 layer->SetTexturePriorities(priority_calculator_); | 1321 layer->SetTexturePriorities(priority_calculator_); |
1323 resource_manager_->PrioritizeTextures(); | 1322 resource_manager_->PrioritizeTextures(); |
1324 layer->Update(queue_.get(), &occluded, NULL); | 1323 layer->Update(queue_.get(), &occluded, NULL); |
1325 EXPECT_EQ(9 - 1, layer->fake_layer_updater()->update_count()); | 1324 EXPECT_EQ(9 - 1, layer->fake_layer_updater()->update_count()); |
1326 | 1325 |
1327 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); | 1326 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); |
1328 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), | 1327 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), |
1329 90000 + 80000, | 1328 90000 + 80000, |
1330 1); | 1329 1); |
1331 EXPECT_EQ(1, occluded.overdraw_metrics()->tiles_culled_for_upload()); | 1330 EXPECT_EQ(1, occluded.overdraw_metrics()->tiles_culled_for_upload()); |
1332 | 1331 |
1333 layer->fake_layer_updater()->ClearUpdateCount(); | 1332 layer->fake_layer_updater()->ClearUpdateCount(); |
1334 | 1333 |
1335 // This makes sure content scaling and transforms work together. | 1334 // This makes sure content scaling and transforms work together. |
1336 gfx::Transform screen_transform; | 1335 gfx::Transform screen_transform; |
1337 screen_transform.Scale(0.5, 0.5); | 1336 screen_transform.Scale(0.5, 0.5); |
1338 layer->draw_properties().screen_space_transform = screen_transform; | 1337 layer->draw_properties().screen_space_transform = screen_transform; |
1339 layer->draw_properties().target_space_transform = screen_transform; | 1338 layer->draw_properties().target_space_transform = screen_transform; |
1340 | 1339 |
1341 occluded.SetOcclusion(gfx::Rect(100, 100, 150, 100)); | 1340 occluded.SetOcclusion(gfx::Rect(100, 100, 150, 100)); |
1342 | 1341 |
1343 gfx::Rect layer_bounds_rect(gfx::Point(), layer->bounds()); | 1342 gfx::Rect layer_bounds_rect(layer->bounds()); |
1344 layer->draw_properties().drawable_content_rect = | 1343 layer->draw_properties().drawable_content_rect = |
1345 gfx::ToEnclosingRect(gfx::ScaleRect(layer_bounds_rect, 0.5)); | 1344 gfx::ToEnclosingRect(gfx::ScaleRect(layer_bounds_rect, 0.5)); |
1346 layer->draw_properties().visible_content_rect = | 1345 layer->draw_properties().visible_content_rect = |
1347 gfx::Rect(gfx::Point(), layer->content_bounds()); | 1346 gfx::Rect(layer->content_bounds()); |
1348 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); | 1347 layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600)); |
1349 layer->SetTexturePriorities(priority_calculator_); | 1348 layer->SetTexturePriorities(priority_calculator_); |
1350 resource_manager_->PrioritizeTextures(); | 1349 resource_manager_->PrioritizeTextures(); |
1351 layer->Update(queue_.get(), &occluded, NULL); | 1350 layer->Update(queue_.get(), &occluded, NULL); |
1352 EXPECT_EQ(9 - 1, layer->fake_layer_updater()->update_count()); | 1351 EXPECT_EQ(9 - 1, layer->fake_layer_updater()->update_count()); |
1353 | 1352 |
1354 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); | 1353 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); |
1355 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), | 1354 EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), |
1356 90000 + 80000 + 80000, | 1355 90000 + 80000 + 80000, |
1357 1); | 1356 1); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 TEST_F(TiledLayerTest, | 1769 TEST_F(TiledLayerTest, |
1771 NonIntegerContentsScaleIsNotDistortedDuringInvalidation) { | 1770 NonIntegerContentsScaleIsNotDistortedDuringInvalidation) { |
1772 scoped_refptr<UpdateTrackingTiledLayer> layer = | 1771 scoped_refptr<UpdateTrackingTiledLayer> layer = |
1773 make_scoped_refptr(new UpdateTrackingTiledLayer(resource_manager_.get())); | 1772 make_scoped_refptr(new UpdateTrackingTiledLayer(resource_manager_.get())); |
1774 | 1773 |
1775 gfx::Rect layer_rect(0, 0, 30, 31); | 1774 gfx::Rect layer_rect(0, 0, 30, 31); |
1776 layer->SetPosition(layer_rect.origin()); | 1775 layer->SetPosition(layer_rect.origin()); |
1777 layer->SetBounds(layer_rect.size()); | 1776 layer->SetBounds(layer_rect.size()); |
1778 layer->UpdateContentsScale(1.3f); | 1777 layer->UpdateContentsScale(1.3f); |
1779 | 1778 |
1780 gfx::Rect content_rect(gfx::Point(), layer->content_bounds()); | 1779 gfx::Rect content_rect(layer->content_bounds()); |
1781 layer->draw_properties().visible_content_rect = content_rect; | 1780 layer->draw_properties().visible_content_rect = content_rect; |
1782 layer->draw_properties().drawable_content_rect = content_rect; | 1781 layer->draw_properties().drawable_content_rect = content_rect; |
1783 | 1782 |
1784 layer->SetTexturePriorities(priority_calculator_); | 1783 layer->SetTexturePriorities(priority_calculator_); |
1785 resource_manager_->PrioritizeTextures(); | 1784 resource_manager_->PrioritizeTextures(); |
1786 | 1785 |
1787 // Update the whole tile. | 1786 // Update the whole tile. |
1788 layer->Update(queue_.get(), 0, NULL); | 1787 layer->Update(queue_.get(), 0, NULL); |
1789 layer->tracking_layer_painter()->ResetPaintedRect(); | 1788 layer->tracking_layer_painter()->ResetPaintedRect(); |
1790 | 1789 |
1791 EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect()); | 1790 EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect()); |
1792 UpdateTextures(); | 1791 UpdateTextures(); |
1793 | 1792 |
1794 // Invalidate the entire layer in layer space. When painting, the rect given | 1793 // Invalidate the entire layer in layer space. When painting, the rect given |
1795 // to webkit should match the layer's bounds. | 1794 // to webkit should match the layer's bounds. |
1796 layer->SetNeedsDisplayRect(layer_rect); | 1795 layer->SetNeedsDisplayRect(layer_rect); |
1797 layer->Update(queue_.get(), 0, NULL); | 1796 layer->Update(queue_.get(), 0, NULL); |
1798 | 1797 |
1799 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); | 1798 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); |
1800 } | 1799 } |
1801 | 1800 |
1802 } // namespace | 1801 } // namespace |
1803 } // namespace cc | 1802 } // namespace cc |
OLD | NEW |