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

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

Issue 2543473004: cc: Move filters from RenderPassDrawQuad to RenderPass (Closed)
Patch Set: Rebase again Created 4 years 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
« no previous file with comments | « cc/test/surface_hittest_test_helpers.cc ('k') | components/exo/surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = AddRenderPass( 6972 RenderPass* child_pass =
6973 &frame->render_passes, 2, gfx::Rect(3, 3, 10, 10), gfx::Transform()); 6973 AddRenderPass(&frame->render_passes, 2, gfx::Rect(3, 3, 10, 10),
6974 gfx::Transform(), FilterOperations());
6974 gpu::SyncToken mailbox_sync_token; 6975 gpu::SyncToken mailbox_sync_token;
6975 AddOneOfEveryQuadType(child_pass, host_impl->resource_provider(), 0, 6976 AddOneOfEveryQuadType(child_pass, host_impl->resource_provider(), 0,
6976 &mailbox_sync_token); 6977 &mailbox_sync_token);
6977 6978
6978 RenderPass* pass = AddRenderPass(&frame->render_passes, 1, 6979 RenderPass* pass =
6979 gfx::Rect(3, 3, 10, 10), gfx::Transform()); 6980 AddRenderPass(&frame->render_passes, 1, gfx::Rect(3, 3, 10, 10),
6981 gfx::Transform(), FilterOperations());
6980 AddOneOfEveryQuadType(pass, host_impl->resource_provider(), child_pass->id, 6982 AddOneOfEveryQuadType(pass, host_impl->resource_provider(), child_pass->id,
6981 &mailbox_sync_token); 6983 &mailbox_sync_token);
6982 return draw_result; 6984 return draw_result;
6983 } 6985 }
6984 6986
6985 void DisplayReceivedCompositorFrameOnThread( 6987 void DisplayReceivedCompositorFrameOnThread(
6986 const CompositorFrame& frame) override { 6988 const CompositorFrame& frame) override {
6987 EXPECT_EQ(2u, frame.render_pass_list.size()); 6989 EXPECT_EQ(2u, frame.render_pass_list.size());
6988 // 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
6989 // 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
6990 // change if AppendOneOfEveryQuadType() is updated, and the value here 6992 // change if AppendOneOfEveryQuadType() is updated, and the value here
6991 // should be updated accordingly. 6993 // should be updated accordingly.
6992 EXPECT_EQ(21u, frame.resource_list.size()); 6994 EXPECT_EQ(21u, frame.resource_list.size());
6993 6995
6994 EndTest(); 6996 EndTest();
6995 } 6997 }
6996 6998
6997 void AfterTest() override {} 6999 void AfterTest() override {}
6998 }; 7000 };
6999 7001
7000 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); 7002 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);
7001 7003
7002 } // namespace 7004 } // namespace
7003 } // namespace cc 7005 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/surface_hittest_test_helpers.cc ('k') | components/exo/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698