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

Side by Side Diff: ui/compositor/layer_unittest.cc

Issue 2609253003: Remove ForceReclaimResources (Closed)
Patch Set: Make test cases / phases the same Created 3 years, 11 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 | « content/test/layouttest_support.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 root->SetBounds(gfx::Rect(0, 0, 10, 10)); 1140 root->SetBounds(gfx::Rect(0, 0, 10, 10));
1141 root->SetVisible(true); 1141 root->SetVisible(true);
1142 WaitForCommit(); 1142 WaitForCommit();
1143 1143
1144 gfx::Rect damaged_rect(0, 0, 5, 5); 1144 gfx::Rect damaged_rect(0, 0, 5, 5);
1145 root->SchedulePaint(damaged_rect); 1145 root->SchedulePaint(damaged_rect);
1146 EXPECT_EQ(damaged_rect, root->damaged_region_for_testing().bounds()); 1146 EXPECT_EQ(damaged_rect, root->damaged_region_for_testing().bounds());
1147 WaitForCommit(); 1147 WaitForCommit();
1148 EXPECT_TRUE(root->damaged_region_for_testing().IsEmpty()); 1148 EXPECT_TRUE(root->damaged_region_for_testing().IsEmpty());
1149 1149
1150 compositor()->SetRootLayer(nullptr); 1150 // The texture mailbox has a reference from an in-flight texture layer.
1151 root.reset(); 1151 // We clear the texture mailbox from the root layer and draw a new frame
1152 WaitForCommit(); 1152 // to ensure that the texture mailbox is released. We then draw a second
1153 // frame to ensure that the mailbox's release callback has time to run.
1154 root->SetShowSolidColorContent();
1155 Draw();
1156 Draw();
1153 } 1157 }
1154 1158
1155 void ExpectRgba(int x, int y, SkColor expected_color, SkColor actual_color) { 1159 void ExpectRgba(int x, int y, SkColor expected_color, SkColor actual_color) {
1156 EXPECT_EQ(expected_color, actual_color) 1160 EXPECT_EQ(expected_color, actual_color)
1157 << "Pixel error at x=" << x << " y=" << y << "; " 1161 << "Pixel error at x=" << x << " y=" << y << "; "
1158 << "actual RGBA=(" 1162 << "actual RGBA=("
1159 << SkColorGetR(actual_color) << "," 1163 << SkColorGetR(actual_color) << ","
1160 << SkColorGetG(actual_color) << "," 1164 << SkColorGetG(actual_color) << ","
1161 << SkColorGetB(actual_color) << "," 1165 << SkColorGetB(actual_color) << ","
1162 << SkColorGetA(actual_color) << "); " 1166 << SkColorGetA(actual_color) << "); "
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 layer.set_name("foo"); 2237 layer.set_name("foo");
2234 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info = 2238 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info =
2235 layer.TakeDebugInfo(nullptr); 2239 layer.TakeDebugInfo(nullptr);
2236 std::string trace_format("bar,"); 2240 std::string trace_format("bar,");
2237 debug_info->AppendAsTraceFormat(&trace_format); 2241 debug_info->AppendAsTraceFormat(&trace_format);
2238 std::string expected("bar,{\"layer_name\":\"foo\"}"); 2242 std::string expected("bar,{\"layer_name\":\"foo\"}");
2239 EXPECT_EQ(expected, trace_format); 2243 EXPECT_EQ(expected, trace_format);
2240 } 2244 }
2241 2245
2242 } // namespace ui 2246 } // namespace ui
OLDNEW
« no previous file with comments | « content/test/layouttest_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698