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

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

Issue 2018833002: cc : Delete LayerImpl::opacity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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/layer_tree_json_parser_unittest.cc ('k') | cc/trees/layer_tree_host_common_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/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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 // without changing content_bounds of the surface. 1177 // without changing content_bounds of the surface.
1178 grand_child2->SetPosition(gfx::PointF(180.f, 180.f)); 1178 grand_child2->SetPosition(gfx::PointF(180.f, 180.f));
1179 { 1179 {
1180 std::unique_ptr<LayerImpl> grand_child3 = 1180 std::unique_ptr<LayerImpl> grand_child3 =
1181 LayerImpl::Create(host_impl_.active_tree(), 6); 1181 LayerImpl::Create(host_impl_.active_tree(), 6);
1182 grand_child3->SetPosition(gfx::PointF(240.f, 240.f)); 1182 grand_child3->SetPosition(gfx::PointF(240.f, 240.f));
1183 grand_child3->SetBounds(gfx::Size(10, 10)); 1183 grand_child3->SetBounds(gfx::Size(10, 10));
1184 grand_child3->SetDrawsContent(true); 1184 grand_child3->SetDrawsContent(true);
1185 child1->AddChild(std::move(grand_child3)); 1185 child1->AddChild(std::move(grand_child3));
1186 } 1186 }
1187 child1->SetOpacity(0.5f); 1187 child1->test_properties()->opacity = 0.5f;
1188 root->layer_tree_impl()->property_trees()->needs_rebuild = true; 1188 root->layer_tree_impl()->property_trees()->needs_rebuild = true;
1189 EmulateDrawingOneFrame(root); 1189 EmulateDrawingOneFrame(root);
1190 1190
1191 // CASE 1: adding a reflection about the left edge of grand_child1. 1191 // CASE 1: adding a reflection about the left edge of grand_child1.
1192 // 1192 //
1193 ClearDamageForAllSurfaces(root); 1193 ClearDamageForAllSurfaces(root);
1194 { 1194 {
1195 std::unique_ptr<LayerImpl> grand_child1_replica = 1195 std::unique_ptr<LayerImpl> grand_child1_replica =
1196 LayerImpl::Create(host_impl_.active_tree(), 7); 1196 LayerImpl::Create(host_impl_.active_tree(), 7);
1197 grand_child1_replica->SetPosition(gfx::PointF()); 1197 grand_child1_replica->SetPosition(gfx::PointF());
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 gfx::Rect root_damage_rect = 1627 gfx::Rect root_damage_rect =
1628 root->render_surface()->damage_tracker()->current_damage_rect(); 1628 root->render_surface()->damage_tracker()->current_damage_rect();
1629 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1629 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1630 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1630 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1631 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1631 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1632 } 1632 }
1633 } 1633 }
1634 1634
1635 } // namespace 1635 } // namespace
1636 } // namespace cc 1636 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_json_parser_unittest.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698