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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 output_surface = make_scoped_ptr( | 57 output_surface = make_scoped_ptr( |
58 new PixelTestOutputSurface(new TestInProcessContextProvider)); | 58 new PixelTestOutputSurface(new TestInProcessContextProvider)); |
59 break; | 59 break; |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 output_surface->set_surface_expansion_size(surface_expansion_size); | 63 output_surface->set_surface_expansion_size(surface_expansion_size); |
64 return output_surface.PassAs<OutputSurface>(); | 64 return output_surface.PassAs<OutputSurface>(); |
65 } | 65 } |
66 | 66 |
67 scoped_refptr<ContextProvider> LayerTreePixelTest::OffscreenContextProvider() { | |
68 return scoped_refptr<ContextProvider>(new TestInProcessContextProvider); | |
69 } | |
70 | |
71 void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) { | 67 void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) { |
72 LayerTreeImpl* commit_tree = | 68 LayerTreeImpl* commit_tree = |
73 impl->pending_tree() ? impl->pending_tree() : impl->active_tree(); | 69 impl->pending_tree() ? impl->pending_tree() : impl->active_tree(); |
74 if (commit_tree->source_frame_number() != 0) | 70 if (commit_tree->source_frame_number() != 0) |
75 return; | 71 return; |
76 | 72 |
77 gfx::Rect viewport = impl->DeviceViewport(); | 73 gfx::Rect viewport = impl->DeviceViewport(); |
78 // The viewport has a 0,0 origin without external influence. | 74 // The viewport has a 0,0 origin without external influence. |
79 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); | 75 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); |
80 // Be that influence! | 76 // Be that influence! |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 358 |
363 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); | 359 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
364 *release_callback = SingleReleaseCallback::Create( | 360 *release_callback = SingleReleaseCallback::Create( |
365 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 361 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
366 base::Unretained(this), | 362 base::Unretained(this), |
367 base::Passed(&context), | 363 base::Passed(&context), |
368 texture_id)); | 364 texture_id)); |
369 } | 365 } |
370 | 366 |
371 } // namespace cc | 367 } // namespace cc |
OLD | NEW |