| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "cc/layers/heads_up_display_layer.h" | 9 #include "cc/layers/heads_up_display_layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 child_resource_provider_ = FakeResourceProvider::Create( | 873 child_resource_provider_ = FakeResourceProvider::Create( |
| 874 child_context_provider_.get(), shared_bitmap_manager_.get()); | 874 child_context_provider_.get(), shared_bitmap_manager_.get()); |
| 875 } | 875 } |
| 876 | 876 |
| 877 static void EmptyReleaseCallback(const gpu::SyncToken& sync_token, | 877 static void EmptyReleaseCallback(const gpu::SyncToken& sync_token, |
| 878 bool lost) {} | 878 bool lost) {} |
| 879 | 879 |
| 880 void SetupTree() override { | 880 void SetupTree() override { |
| 881 gpu::gles2::GLES2Interface* gl = child_context_provider_->ContextGL(); | 881 gpu::gles2::GLES2Interface* gl = child_context_provider_->ContextGL(); |
| 882 | 882 |
| 883 std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | |
| 884 | |
| 885 std::unique_ptr<RenderPass> pass_for_quad = RenderPass::Create(); | |
| 886 pass_for_quad->SetNew( | |
| 887 // AppendOneOfEveryQuadType() makes a RenderPass quad with this id. | |
| 888 RenderPassId(2, 1), gfx::Rect(0, 0, 10, 10), gfx::Rect(0, 0, 10, 10), | |
| 889 gfx::Transform()); | |
| 890 | |
| 891 std::unique_ptr<RenderPass> pass = RenderPass::Create(); | |
| 892 pass->SetNew(RenderPassId(1, 1), gfx::Rect(0, 0, 10, 10), | |
| 893 gfx::Rect(0, 0, 10, 10), gfx::Transform()); | |
| 894 gpu::SyncToken mailbox_sync_token; | |
| 895 AddOneOfEveryQuadType(pass.get(), child_resource_provider_.get(), | |
| 896 RenderPassId(2, 1), &mailbox_sync_token); | |
| 897 | |
| 898 frame_data->render_pass_list.push_back(std::move(pass_for_quad)); | |
| 899 frame_data->render_pass_list.push_back(std::move(pass)); | |
| 900 | |
| 901 ResourceId resource = child_resource_provider_->CreateResource( | 883 ResourceId resource = child_resource_provider_->CreateResource( |
| 902 gfx::Size(4, 4), ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888, | 884 gfx::Size(4, 4), ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888, |
| 903 gfx::ColorSpace()); | 885 gfx::ColorSpace()); |
| 904 ResourceProvider::ScopedWriteLockGL lock(child_resource_provider_.get(), | 886 ResourceProvider::ScopedWriteLockGL lock(child_resource_provider_.get(), |
| 905 resource, false); | 887 resource, false); |
| 906 | 888 |
| 907 gpu::Mailbox mailbox; | 889 gpu::Mailbox mailbox; |
| 908 gl->GenMailboxCHROMIUM(mailbox.name); | 890 gl->GenMailboxCHROMIUM(mailbox.name); |
| 909 | 891 |
| 910 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); | 892 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 | 1635 |
| 1654 FakeContentLayerClient client_; | 1636 FakeContentLayerClient client_; |
| 1655 int num_draws_ = 0; | 1637 int num_draws_ = 0; |
| 1656 }; | 1638 }; |
| 1657 | 1639 |
| 1658 MULTI_THREAD_TEST_F( | 1640 MULTI_THREAD_TEST_F( |
| 1659 LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles); | 1641 LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles); |
| 1660 | 1642 |
| 1661 } // namespace | 1643 } // namespace |
| 1662 } // namespace cc | 1644 } // namespace cc |
| OLD | NEW |