OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 6951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6962 | 6962 |
6963 class LayerTreeHostTestSubmitFrameResources : public LayerTreeHostTest { | 6963 class LayerTreeHostTestSubmitFrameResources : public LayerTreeHostTest { |
6964 protected: | 6964 protected: |
6965 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 6965 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
6966 | 6966 |
6967 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | 6967 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
6968 LayerTreeHostImpl::FrameData* frame, | 6968 LayerTreeHostImpl::FrameData* frame, |
6969 DrawResult draw_result) override { | 6969 DrawResult draw_result) override { |
6970 frame->render_passes.clear(); | 6970 frame->render_passes.clear(); |
6971 | 6971 |
6972 RenderPass* child_pass = | 6972 RenderPass* child_pass = AddRenderPass( |
6973 AddRenderPass(&frame->render_passes, RenderPassId(2, 1), | 6973 &frame->render_passes, RenderPassId(2, 1), gfx::Rect(3, 3, 10, 10), |
6974 gfx::Rect(3, 3, 10, 10), gfx::Transform()); | 6974 gfx::Transform(), FilterOperations()); |
6975 gpu::SyncToken mailbox_sync_token; | 6975 gpu::SyncToken mailbox_sync_token; |
6976 AddOneOfEveryQuadType(child_pass, host_impl->resource_provider(), | 6976 AddOneOfEveryQuadType(child_pass, host_impl->resource_provider(), |
6977 RenderPassId(0, 0), &mailbox_sync_token); | 6977 RenderPassId(0, 0), &mailbox_sync_token); |
6978 | 6978 |
6979 RenderPass* pass = AddRenderPass(&frame->render_passes, RenderPassId(1, 1), | 6979 RenderPass* pass = AddRenderPass(&frame->render_passes, RenderPassId(1, 1), |
6980 gfx::Rect(3, 3, 10, 10), gfx::Transform()); | 6980 gfx::Rect(3, 3, 10, 10), gfx::Transform(), |
| 6981 FilterOperations()); |
6981 AddOneOfEveryQuadType(pass, host_impl->resource_provider(), child_pass->id, | 6982 AddOneOfEveryQuadType(pass, host_impl->resource_provider(), child_pass->id, |
6982 &mailbox_sync_token); | 6983 &mailbox_sync_token); |
6983 return draw_result; | 6984 return draw_result; |
6984 } | 6985 } |
6985 | 6986 |
6986 void DisplayReceivedCompositorFrameOnThread( | 6987 void DisplayReceivedCompositorFrameOnThread( |
6987 const CompositorFrame& frame) override { | 6988 const CompositorFrame& frame) override { |
6988 EXPECT_EQ(2u, frame.render_pass_list.size()); | 6989 EXPECT_EQ(2u, frame.render_pass_list.size()); |
6989 // Each render pass has 10 resources in it. And the root render pass has a | 6990 // Each render pass has 10 resources in it. And the root render pass has a |
6990 // mask resource used when drawing the child render pass. The number 10 may | 6991 // mask resource used when drawing the child render pass. The number 10 may |
6991 // change if AppendOneOfEveryQuadType() is updated, and the value here | 6992 // change if AppendOneOfEveryQuadType() is updated, and the value here |
6992 // should be updated accordingly. | 6993 // should be updated accordingly. |
6993 EXPECT_EQ(21u, frame.resource_list.size()); | 6994 EXPECT_EQ(21u, frame.resource_list.size()); |
6994 | 6995 |
6995 EndTest(); | 6996 EndTest(); |
6996 } | 6997 } |
6997 | 6998 |
6998 void AfterTest() override {} | 6999 void AfterTest() override {} |
6999 }; | 7000 }; |
7000 | 7001 |
7001 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); | 7002 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); |
7002 | 7003 |
7003 } // namespace | 7004 } // namespace |
7004 } // namespace cc | 7005 } // namespace cc |
OLD | NEW |