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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 layer->SetBounds(rect.size()); | 123 layer->SetBounds(rect.size()); |
124 layer->SetPosition(rect.origin()); | 124 layer->SetPosition(rect.origin()); |
125 layer->SetBackgroundColor(color); | 125 layer->SetBackgroundColor(color); |
126 return layer; | 126 return layer; |
127 } | 127 } |
128 | 128 |
129 void LayerTreePixelTest::EndTest() { | 129 void LayerTreePixelTest::EndTest() { |
130 // Drop TextureMailboxes on the main thread so that they can be cleaned up and | 130 // Drop TextureMailboxes on the main thread so that they can be cleaned up and |
131 // the pending callbacks will fire. | 131 // the pending callbacks will fire. |
132 for (size_t i = 0; i < texture_layers_.size(); ++i) { | 132 for (size_t i = 0; i < texture_layers_.size(); ++i) { |
133 texture_layers_[i]->SetTextureMailbox(TextureMailbox(), | 133 texture_layers_[i]->SetTextureMailbox(TextureMailbox(), nullptr); |
134 scoped_ptr<SingleReleaseCallback>()); | |
135 } | 134 } |
136 | 135 |
137 TryEndTest(); | 136 TryEndTest(); |
138 } | 137 } |
139 | 138 |
140 void LayerTreePixelTest::TryEndTest() { | 139 void LayerTreePixelTest::TryEndTest() { |
141 if (!result_bitmap_) | 140 if (!result_bitmap_) |
142 return; | 141 return; |
143 if (pending_texture_mailbox_callbacks_) | 142 if (pending_texture_mailbox_callbacks_) |
144 return; | 143 return; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 360 |
362 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); | 361 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
363 *release_callback = SingleReleaseCallback::Create( | 362 *release_callback = SingleReleaseCallback::Create( |
364 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 363 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
365 base::Unretained(this), | 364 base::Unretained(this), |
366 base::Passed(&context), | 365 base::Passed(&context), |
367 texture_id)); | 366 texture_id)); |
368 } | 367 } |
369 | 368 |
370 } // namespace cc | 369 } // namespace cc |
OLD | NEW |