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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 impl->pending_tree() ? impl->pending_tree() : impl->active_tree(); | 69 impl->pending_tree() ? impl->pending_tree() : impl->active_tree(); |
70 if (commit_tree->source_frame_number() != 0) | 70 if (commit_tree->source_frame_number() != 0) |
71 return; | 71 return; |
72 | 72 |
73 gfx::Rect viewport = impl->DeviceViewport(); | 73 gfx::Rect viewport = impl->DeviceViewport(); |
74 // The viewport has a 0,0 origin without external influence. | 74 // The viewport has a 0,0 origin without external influence. |
75 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); | 75 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); |
76 // Be that influence! | 76 // Be that influence! |
77 viewport += gfx::Vector2d(20, 10); | 77 viewport += gfx::Vector2d(20, 10); |
78 bool resourceless_software_draw = false; | 78 bool resourceless_software_draw = false; |
79 impl->SetExternalDrawConstraints( | 79 gfx::Transform identity = gfx::Transform(); |
80 gfx::Transform(), viewport, viewport, resourceless_software_draw); | 80 impl->SetExternalDrawConstraints(identity, |
| 81 viewport, |
| 82 viewport, |
| 83 viewport, |
| 84 identity, |
| 85 resourceless_software_draw); |
81 EXPECT_EQ(viewport.ToString(), impl->DeviceViewport().ToString()); | 86 EXPECT_EQ(viewport.ToString(), impl->DeviceViewport().ToString()); |
82 } | 87 } |
83 | 88 |
84 scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() { | 89 scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() { |
85 return CopyOutputRequest::CreateBitmapRequest( | 90 return CopyOutputRequest::CreateBitmapRequest( |
86 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this))); | 91 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this))); |
87 } | 92 } |
88 | 93 |
89 void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) { | 94 void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) { |
90 ASSERT_TRUE(result->HasBitmap()); | 95 ASSERT_TRUE(result->HasBitmap()); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 362 |
358 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); | 363 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
359 *release_callback = SingleReleaseCallback::Create( | 364 *release_callback = SingleReleaseCallback::Create( |
360 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 365 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
361 base::Unretained(this), | 366 base::Unretained(this), |
362 base::Passed(&context), | 367 base::Passed(&context), |
363 texture_id)); | 368 texture_id)); |
364 } | 369 } |
365 | 370 |
366 } // namespace cc | 371 } // namespace cc |
OLD | NEW |