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/test/layer_tree_pixel_test.h" | 5 #include "cc/test/layer_tree_pixel_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "cc/base/switches.h" | 9 #include "cc/base/switches.h" |
10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
11 #include "cc/layers/texture_layer.h" | 11 #include "cc/layers/texture_layer.h" |
12 #include "cc/output/copy_output_request.h" | 12 #include "cc/output/copy_output_request.h" |
13 #include "cc/output/copy_output_result.h" | 13 #include "cc/output/copy_output_result.h" |
| 14 #include "cc/output/direct_renderer.h" |
14 #include "cc/resources/texture_mailbox.h" | 15 #include "cc/resources/texture_mailbox.h" |
15 #include "cc/test/paths.h" | 16 #include "cc/test/paths.h" |
16 #include "cc/test/pixel_comparator.h" | 17 #include "cc/test/pixel_comparator.h" |
17 #include "cc/test/pixel_test_output_surface.h" | 18 #include "cc/test/pixel_test_output_surface.h" |
18 #include "cc/test/pixel_test_software_output_device.h" | 19 #include "cc/test/pixel_test_software_output_device.h" |
19 #include "cc/test/pixel_test_utils.h" | 20 #include "cc/test/pixel_test_utils.h" |
20 #include "cc/test/test_in_process_context_provider.h" | 21 #include "cc/test/test_in_process_context_provider.h" |
21 #include "cc/trees/layer_tree_impl.h" | 22 #include "cc/trees/layer_tree_impl.h" |
22 #include "gpu/command_buffer/client/gl_in_process_context.h" | 23 #include "gpu/command_buffer/client/gl_in_process_context.h" |
23 #include "gpu/command_buffer/client/gles2_implementation.h" | 24 #include "gpu/command_buffer/client/gles2_implementation.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 output_surface->set_surface_expansion_size(surface_expansion_size); | 61 output_surface->set_surface_expansion_size(surface_expansion_size); |
61 return output_surface.Pass(); | 62 return output_surface.Pass(); |
62 } | 63 } |
63 | 64 |
64 void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) { | 65 void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) { |
65 LayerTreeImpl* commit_tree = | 66 LayerTreeImpl* commit_tree = |
66 impl->pending_tree() ? impl->pending_tree() : impl->active_tree(); | 67 impl->pending_tree() ? impl->pending_tree() : impl->active_tree(); |
67 if (commit_tree->source_frame_number() != 0) | 68 if (commit_tree->source_frame_number() != 0) |
68 return; | 69 return; |
69 | 70 |
| 71 DirectRenderer* renderer = static_cast<DirectRenderer*>(impl->renderer()); |
| 72 renderer->SetEnlargePassTextureAmountForTesting(enlarge_texture_amount_); |
| 73 |
70 gfx::Rect viewport = impl->DeviceViewport(); | 74 gfx::Rect viewport = impl->DeviceViewport(); |
71 // The viewport has a 0,0 origin without external influence. | 75 // The viewport has a 0,0 origin without external influence. |
72 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); | 76 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); |
73 // Be that influence! | 77 // Be that influence! |
74 viewport += gfx::Vector2d(20, 10); | 78 viewport += gfx::Vector2d(20, 10); |
75 bool resourceless_software_draw = false; | 79 bool resourceless_software_draw = false; |
76 gfx::Transform identity = gfx::Transform(); | 80 gfx::Transform identity = gfx::Transform(); |
77 impl->SetExternalDrawConstraints(identity, | 81 impl->SetExternalDrawConstraints(identity, |
78 viewport, | 82 viewport, |
79 viewport, | 83 viewport, |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 375 |
372 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); | 376 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
373 *release_callback = SingleReleaseCallback::Create( | 377 *release_callback = SingleReleaseCallback::Create( |
374 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 378 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
375 base::Unretained(this), | 379 base::Unretained(this), |
376 base::Passed(&context), | 380 base::Passed(&context), |
377 texture_id)); | 381 texture_id)); |
378 } | 382 } |
379 | 383 |
380 } // namespace cc | 384 } // namespace cc |
OLD | NEW |