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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 12662021: cc: Don't draw and swap if the frame will not change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add perf test Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 26e0e82720c5860d52842e17216eaf0963af0b31..68321e46707a64d8013ba81d3b3462b74b461db7 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -155,7 +155,8 @@ class LayerTreeHostContextTest : public LayerTreeTest {
LayerTreeHostImpl::FrameData* frame,
bool result)
OVERRIDE {
- EXPECT_TRUE(result);
+ bool expect_success = !frame->has_no_damage;
+ EXPECT_EQ(expect_success, result);
if (!times_to_lose_during_draw_)
return result;
@@ -270,7 +271,8 @@ class LayerTreeHostContextTestLostContextSucceeds :
}
virtual void InvalidateAndSetNeedsCommit() {
- layer_tree_host()->SetNeedsCommit();
+ // Cause damage so we try to draw.
+ layer_tree_host()->root_layer()->SetNeedsDisplay();
}
bool NextTestCase() {
@@ -1056,10 +1058,9 @@ class LayerTreeHostContextTestDontUseLostResources :
}
}
- virtual bool PrepareToDrawOnThread(
- LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame,
- bool result) OVERRIDE {
+ virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame,
+ bool result) OVERRIDE {
if (host_impl->active_tree()->source_frame_number() == 2) {
// Lose the context during draw on the second commit. This will cause
// a third commit to recover.

Powered by Google App Engine
This is Rietveld 408576698