OLD | NEW |
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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 Renderer* renderer = host_impl->renderer(); | 381 Renderer* renderer = host_impl->renderer(); |
382 | 382 |
383 LayerImpl* root = host_impl->active_tree()->root_layer(); | 383 LayerImpl* root = host_impl->active_tree()->root_layer(); |
384 LayerImpl* grand_parent = root->children()[0]; | 384 LayerImpl* grand_parent = root->children()[0]; |
385 LayerImpl* parent = grand_parent->children()[0]; | 385 LayerImpl* parent = grand_parent->children()[0]; |
386 LayerImpl* copy_layer = parent->children()[0]; | 386 LayerImpl* copy_layer = parent->children()[0]; |
387 | 387 |
388 // |parent| owns a surface, but it was hidden and not part of the copy | 388 // |parent| owns a surface, but it was hidden and not part of the copy |
389 // request so it should not allocate any resource. | 389 // request so it should not allocate any resource. |
390 EXPECT_FALSE(renderer->HasAllocatedResourcesForTesting( | 390 EXPECT_FALSE(renderer->HasAllocatedResourcesForTesting( |
391 parent->render_surface()->RenderPassId())); | 391 parent->render_surface()->GetRenderPassId())); |
392 | 392 |
393 // |copy_layer| should have been rendered to a texture since it was needed | 393 // |copy_layer| should have been rendered to a texture since it was needed |
394 // for a copy request. | 394 // for a copy request. |
395 EXPECT_TRUE(renderer->HasAllocatedResourcesForTesting( | 395 EXPECT_TRUE(renderer->HasAllocatedResourcesForTesting( |
396 copy_layer->render_surface()->RenderPassId())); | 396 copy_layer->render_surface()->GetRenderPassId())); |
397 | 397 |
398 did_draw_ = true; | 398 did_draw_ = true; |
399 } | 399 } |
400 | 400 |
401 virtual void AfterTest() OVERRIDE { EXPECT_TRUE(did_draw_); } | 401 virtual void AfterTest() OVERRIDE { EXPECT_TRUE(did_draw_); } |
402 | 402 |
403 FakeContentLayerClient client_; | 403 FakeContentLayerClient client_; |
404 bool did_draw_; | 404 bool did_draw_; |
405 scoped_refptr<FakeContentLayer> root_; | 405 scoped_refptr<FakeContentLayer> root_; |
406 scoped_refptr<FakeContentLayer> grand_parent_layer_; | 406 scoped_refptr<FakeContentLayer> grand_parent_layer_; |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 FakeContentLayerClient client_; | 965 FakeContentLayerClient client_; |
966 scoped_refptr<FakeContentLayer> root_; | 966 scoped_refptr<FakeContentLayer> root_; |
967 scoped_refptr<FakeContentLayer> copy_layer_; | 967 scoped_refptr<FakeContentLayer> copy_layer_; |
968 }; | 968 }; |
969 | 969 |
970 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 970 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
971 LayerTreeHostCopyRequestTestShutdownBeforeCopy); | 971 LayerTreeHostCopyRequestTestShutdownBeforeCopy); |
972 | 972 |
973 } // namespace | 973 } // namespace |
974 } // namespace cc | 974 } // namespace cc |
OLD | NEW |