| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 software_output_device->set_surface_expansion_size( | 48 software_output_device->set_surface_expansion_size( |
| 49 surface_expansion_size); | 49 surface_expansion_size); |
| 50 output_surface = make_scoped_ptr( | 50 output_surface = make_scoped_ptr( |
| 51 new PixelTestOutputSurface( | 51 new PixelTestOutputSurface( |
| 52 software_output_device.PassAs<SoftwareOutputDevice>())); | 52 software_output_device.PassAs<SoftwareOutputDevice>())); |
| 53 break; | 53 break; |
| 54 } | 54 } |
| 55 | 55 |
| 56 case GL_WITH_DEFAULT: | 56 case GL_WITH_DEFAULT: |
| 57 case GL_WITH_BITMAP: { | 57 case GL_WITH_BITMAP: { |
| 58 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 58 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL)); |
| 59 | 59 |
| 60 output_surface = make_scoped_ptr( | 60 output_surface = make_scoped_ptr( |
| 61 new PixelTestOutputSurface(new TestInProcessContextProvider)); | 61 new PixelTestOutputSurface(new TestInProcessContextProvider)); |
| 62 break; | 62 break; |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 output_surface->set_surface_expansion_size(surface_expansion_size); | 66 output_surface->set_surface_expansion_size(surface_expansion_size); |
| 67 return output_surface.PassAs<OutputSurface>(); | 67 return output_surface.PassAs<OutputSurface>(); |
| 68 } | 68 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 TryEndTest(); | 309 TryEndTest(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void LayerTreePixelTest::CopyBitmapToTextureMailboxAsTexture( | 312 void LayerTreePixelTest::CopyBitmapToTextureMailboxAsTexture( |
| 313 const SkBitmap& bitmap, | 313 const SkBitmap& bitmap, |
| 314 TextureMailbox* texture_mailbox, | 314 TextureMailbox* texture_mailbox, |
| 315 scoped_ptr<SingleReleaseCallback>* release_callback) { | 315 scoped_ptr<SingleReleaseCallback>* release_callback) { |
| 316 DCHECK_GT(bitmap.width(), 0); | 316 DCHECK_GT(bitmap.width(), 0); |
| 317 DCHECK_GT(bitmap.height(), 0); | 317 DCHECK_GT(bitmap.height(), 0); |
| 318 | 318 |
| 319 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 319 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL)); |
| 320 | 320 |
| 321 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); | 321 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); |
| 322 GLES2Interface* gl = context->GetImplementation(); | 322 GLES2Interface* gl = context->GetImplementation(); |
| 323 | 323 |
| 324 GLuint texture_id = 0; | 324 GLuint texture_id = 0; |
| 325 gl->GenTextures(1, &texture_id); | 325 gl->GenTextures(1, &texture_id); |
| 326 gl->BindTexture(GL_TEXTURE_2D, texture_id); | 326 gl->BindTexture(GL_TEXTURE_2D, texture_id); |
| 327 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 327 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 328 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 328 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| 329 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 329 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| (...skipping 41 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 |