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

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: Rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6b95121ac7ee304f513f6f4af07130f18b9c0fe1..abde0a85a4b874d7d2b6ff4a876efb3d2ae9e5ef 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;
@@ -269,7 +270,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() {
@@ -1050,10 +1052,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.
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698