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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 void LayerTreePixelTest::SetupTree() { | 222 void LayerTreePixelTest::SetupTree() { |
223 scoped_refptr<Layer> root = Layer::Create(); | 223 scoped_refptr<Layer> root = Layer::Create(); |
224 root->SetBounds(content_root_->bounds()); | 224 root->SetBounds(content_root_->bounds()); |
225 root->AddChild(content_root_); | 225 root->AddChild(content_root_); |
226 layer_tree_host()->SetRootLayer(root); | 226 layer_tree_host()->SetRootLayer(root); |
227 LayerTreeTest::SetupTree(); | 227 LayerTreeTest::SetupTree(); |
228 } | 228 } |
229 | 229 |
230 scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap( | 230 scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap( |
231 gfx::Size size, | 231 const gfx::Size& size, |
232 const TextureMailbox& texture_mailbox) { | 232 const TextureMailbox& texture_mailbox) { |
233 DCHECK(texture_mailbox.IsTexture()); | 233 DCHECK(texture_mailbox.IsTexture()); |
234 if (!texture_mailbox.IsTexture()) | 234 if (!texture_mailbox.IsTexture()) |
235 return scoped_ptr<SkBitmap>(); | 235 return scoped_ptr<SkBitmap>(); |
236 | 236 |
237 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); | 237 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); |
238 GLES2Interface* gl = context->GetImplementation(); | 238 GLES2Interface* gl = context->GetImplementation(); |
239 | 239 |
240 if (texture_mailbox.sync_point()) | 240 if (texture_mailbox.sync_point()) |
241 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point()); | 241 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point()); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 371 |
372 *texture_mailbox = TextureMailbox(mailbox, sync_point); | 372 *texture_mailbox = TextureMailbox(mailbox, sync_point); |
373 *release_callback = SingleReleaseCallback::Create( | 373 *release_callback = SingleReleaseCallback::Create( |
374 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 374 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
375 base::Unretained(this), | 375 base::Unretained(this), |
376 base::Passed(&context), | 376 base::Passed(&context), |
377 texture_id)); | 377 texture_id)); |
378 } | 378 } |
379 | 379 |
380 } // namespace cc | 380 } // namespace cc |
OLD | NEW |