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

Side by Side Diff: cc/layers/texture_layer_unittest.cc

Issue 16888015: Reland r206537 - cc: Don't return mailboxes if the TextureLayer is removed from the tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/texture_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "cc/base/thread.h" 10 #include "cc/base/thread.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 break; 406 break;
407 case 6: 407 case 6:
408 // Old mailbox was released, task was posted, but won't execute 408 // Old mailbox was released, task was posted, but won't execute
409 // until this DidCommit returns. 409 // until this DidCommit returns.
410 // TODO(piman): fix this. 410 // TODO(piman): fix this.
411 EXPECT_EQ(3, callback_count_); 411 EXPECT_EQ(3, callback_count_);
412 layer_tree_host()->SetNeedsCommit(); 412 layer_tree_host()->SetNeedsCommit();
413 break; 413 break;
414 case 7: 414 case 7:
415 EXPECT_EQ(4, callback_count_); 415 EXPECT_EQ(4, callback_count_);
416 // Restore a mailbox for the next step.
417 SetMailbox('5');
418 break;
419 case 8:
420 // Case #5: remove layer from tree. Callback should *not* be called, the
421 // mailbox is returned to the main thread.
422 EXPECT_EQ(4, callback_count_);
423 layer_->RemoveFromParent();
424 break;
425 case 9:
426 // Mailbox was released to the main thread, task was posted, but won't
427 // execute until this DidCommit returns.
428 // TODO(piman): fix this.
429 EXPECT_EQ(4, callback_count_);
430 layer_tree_host()->SetNeedsCommit();
431 break;
432 case 10:
433 EXPECT_EQ(4, callback_count_);
434 // Resetting the mailbox will call the callback now.
435 layer_->SetTextureMailbox(TextureMailbox());
436 EXPECT_EQ(5, callback_count_);
416 EndTest(); 437 EndTest();
417 break; 438 break;
418 default: 439 default:
419 NOTREACHED(); 440 NOTREACHED();
420 break; 441 break;
421 } 442 }
422 } 443 }
423 444
424 virtual void AfterTest() OVERRIDE {} 445 virtual void AfterTest() OVERRIDE {}
425 446
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 base::Lock lock_; 738 base::Lock lock_;
718 unsigned expected_used_textures_on_commit_; 739 unsigned expected_used_textures_on_commit_;
719 }; 740 };
720 741
721 // The TextureLayerClient does not use mailboxes, so can't use a delegating 742 // The TextureLayerClient does not use mailboxes, so can't use a delegating
722 // renderer. 743 // renderer.
723 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerClientTest); 744 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerClientTest);
724 745
725 } // namespace 746 } // namespace
726 } // namespace cc 747 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698