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

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

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c301e01d Rebase. Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/output/copy_output_request.h" 5 #include "cc/output/copy_output_request.h"
6 #include "cc/output/copy_output_result.h" 6 #include "cc/output/copy_output_result.h"
7 #include "cc/test/fake_content_layer.h" 7 #include "cc/test/fake_content_layer.h"
8 #include "cc/test/fake_content_layer_client.h" 8 #include "cc/test/fake_content_layer_client.h"
9 #include "cc/test/fake_output_surface.h" 9 #include "cc/test/fake_output_surface.h"
10 #include "cc/test/layer_tree_test.h" 10 #include "cc/test/layer_tree_test.h"
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 // Request a copy to a provided texture. This should not create a new 799 // Request a copy to a provided texture. This should not create a new
800 // texture. 800 // texture.
801 scoped_ptr<CopyOutputRequest> request = 801 scoped_ptr<CopyOutputRequest> request =
802 CopyOutputRequest::CreateRequest(base::Bind( 802 CopyOutputRequest::CreateRequest(base::Bind(
803 &LayerTreeHostCopyRequestTestProvideTexture::CopyOutputCallback, 803 &LayerTreeHostCopyRequestTestProvideTexture::CopyOutputCallback,
804 base::Unretained(this))); 804 base::Unretained(this)));
805 805
806 gpu::Mailbox mailbox; 806 gpu::Mailbox mailbox;
807 external_context_provider_->Context3d()->genMailboxCHROMIUM(mailbox.name); 807 external_context_provider_->Context3d()->genMailboxCHROMIUM(mailbox.name);
808 sync_point_ = external_context_provider_->Context3d()->insertSyncPoint(); 808 sync_point_ = external_context_provider_->Context3d()->insertSyncPoint();
809 request->SetTextureMailbox(TextureMailbox(mailbox, sync_point_)); 809 request->SetTextureMailbox(
810 TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point_));
810 EXPECT_TRUE(request->has_texture_mailbox()); 811 EXPECT_TRUE(request->has_texture_mailbox());
811 812
812 copy_layer_->RequestCopyOfOutput(request.Pass()); 813 copy_layer_->RequestCopyOfOutput(request.Pass());
813 } 814 }
814 815
815 virtual void AfterTest() OVERRIDE { 816 virtual void AfterTest() OVERRIDE {
816 // Expect the compositor to have waited for the sync point in the provided 817 // Expect the compositor to have waited for the sync point in the provided
817 // TextureMailbox. 818 // TextureMailbox.
818 EXPECT_EQ(sync_point_, waited_sync_point_after_readback_); 819 EXPECT_EQ(sync_point_, waited_sync_point_after_readback_);
819 // Except the copy to have *not* made another texture. 820 // Except the copy to have *not* made another texture.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 FakeContentLayerClient client_; 900 FakeContentLayerClient client_;
900 scoped_refptr<FakeContentLayer> root_; 901 scoped_refptr<FakeContentLayer> root_;
901 scoped_refptr<FakeContentLayer> copy_layer_; 902 scoped_refptr<FakeContentLayer> copy_layer_;
902 }; 903 };
903 904
904 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 905 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
905 LayerTreeHostCopyRequestTestDestroyBeforeCopy); 906 LayerTreeHostCopyRequestTestDestroyBeforeCopy);
906 907
907 } // namespace 908 } // namespace
908 } // namespace cc 909 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698