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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 scoped_ptr<PixelTestSoftwareOutputDevice> software_output_device( | 45 scoped_ptr<PixelTestSoftwareOutputDevice> software_output_device( |
46 new PixelTestSoftwareOutputDevice); | 46 new PixelTestSoftwareOutputDevice); |
47 software_output_device->set_surface_expansion_size( | 47 software_output_device->set_surface_expansion_size( |
48 surface_expansion_size); | 48 surface_expansion_size); |
49 output_surface = make_scoped_ptr( | 49 output_surface = make_scoped_ptr( |
50 new PixelTestOutputSurface(software_output_device.Pass())); | 50 new PixelTestOutputSurface(software_output_device.Pass())); |
51 break; | 51 break; |
52 } | 52 } |
53 case PIXEL_TEST_GL: { | 53 case PIXEL_TEST_GL: { |
54 output_surface = make_scoped_ptr( | 54 output_surface = make_scoped_ptr( |
55 new PixelTestOutputSurface(new TestInProcessContextProvider)); | 55 new PixelTestOutputSurface(CreteTestContextProvider())); |
56 break; | 56 break; |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 output_surface->set_surface_expansion_size(surface_expansion_size); | 60 output_surface->set_surface_expansion_size(surface_expansion_size); |
61 return output_surface.Pass(); | 61 return output_surface.Pass(); |
62 } | 62 } |
63 | 63 |
64 void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) { | 64 void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) { |
65 LayerTreeImpl* commit_tree = | 65 LayerTreeImpl* commit_tree = |
(...skipping 10 matching lines...) Expand all Loading... |
76 gfx::Transform identity = gfx::Transform(); | 76 gfx::Transform identity = gfx::Transform(); |
77 impl->SetExternalDrawConstraints(identity, | 77 impl->SetExternalDrawConstraints(identity, |
78 viewport, | 78 viewport, |
79 viewport, | 79 viewport, |
80 viewport, | 80 viewport, |
81 identity, | 81 identity, |
82 resourceless_software_draw); | 82 resourceless_software_draw); |
83 EXPECT_EQ(viewport.ToString(), impl->DeviceViewport().ToString()); | 83 EXPECT_EQ(viewport.ToString(), impl->DeviceViewport().ToString()); |
84 } | 84 } |
85 | 85 |
| 86 scoped_refptr<ContextProvider> LayerTreePixelTest::CreteTestContextProvider() { |
| 87 return new TestInProcessContextProvider(); |
| 88 } |
| 89 |
86 scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() { | 90 scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() { |
87 return CopyOutputRequest::CreateBitmapRequest( | 91 return CopyOutputRequest::CreateBitmapRequest( |
88 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this))); | 92 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this))); |
89 } | 93 } |
90 | 94 |
91 void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) { | 95 void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) { |
92 ASSERT_TRUE(result->HasBitmap()); | 96 ASSERT_TRUE(result->HasBitmap()); |
93 result_bitmap_ = result->TakeBitmap().Pass(); | 97 result_bitmap_ = result->TakeBitmap().Pass(); |
94 EndTest(); | 98 EndTest(); |
95 } | 99 } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 362 |
359 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); | 363 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
360 *release_callback = SingleReleaseCallback::Create( | 364 *release_callback = SingleReleaseCallback::Create( |
361 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 365 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
362 base::Unretained(this), | 366 base::Unretained(this), |
363 base::Passed(&context), | 367 base::Passed(&context), |
364 texture_id)); | 368 texture_id)); |
365 } | 369 } |
366 | 370 |
367 } // namespace cc | 371 } // namespace cc |
OLD | NEW |