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

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

Issue 1868003002: cc: Move RenderTarget Information to Effect Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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/damage_tracker.h" 5 #include "cc/trees/damage_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 TEST_F(DamageTrackerTest, VerifyDamageForEmptyLayerList) { 1464 TEST_F(DamageTrackerTest, VerifyDamageForEmptyLayerList) {
1465 // Though it should never happen, its a good idea to verify that the damage 1465 // Though it should never happen, its a good idea to verify that the damage
1466 // tracker does not crash when it receives an empty layer_list. 1466 // tracker does not crash when it receives an empty layer_list.
1467 1467
1468 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.active_tree(), 1); 1468 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_.active_tree(), 1);
1469 root->SetForceRenderSurface(true); 1469 root->SetForceRenderSurface(true);
1470 host_impl_.active_tree()->SetRootLayer(std::move(root)); 1470 host_impl_.active_tree()->SetRootLayer(std::move(root));
1471 LayerImpl* root_ptr = host_impl_.active_tree()->root_layer(); 1471 LayerImpl* root_ptr = host_impl_.active_tree()->root_layer();
1472 root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true; 1472 root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true;
1473 EmulateDrawingOneFrame(root_ptr); 1473 EmulateDrawingOneFrame(root_ptr);
1474 root_ptr->draw_properties().render_target = root_ptr;
1475 1474
1476 ASSERT_EQ(root_ptr, root_ptr->render_target()); 1475 DCHECK_EQ(root_ptr->render_surface(), root_ptr->render_target());
1477 RenderSurfaceImpl* target_surface = root_ptr->render_surface(); 1476 RenderSurfaceImpl* target_surface = root_ptr->render_surface();
1478 1477
1479 LayerImplList empty_list; 1478 LayerImplList empty_list;
1480 target_surface->damage_tracker()->UpdateDamageTrackingState( 1479 target_surface->damage_tracker()->UpdateDamageTrackingState(
1481 empty_list, 1480 empty_list,
1482 target_surface->OwningLayerId(), 1481 target_surface->OwningLayerId(),
1483 false, 1482 false,
1484 gfx::Rect(), 1483 gfx::Rect(),
1485 NULL, 1484 NULL,
1486 FilterOperations()); 1485 FilterOperations());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 gfx::Rect root_damage_rect = 1558 gfx::Rect root_damage_rect =
1560 root->render_surface()->damage_tracker()->current_damage_rect(); 1559 root->render_surface()->damage_tracker()->current_damage_rect();
1561 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1560 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1562 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1561 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1563 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1562 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1564 } 1563 }
1565 } 1564 }
1566 1565
1567 } // namespace 1566 } // namespace
1568 } // namespace cc 1567 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698