Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: cc/test/layer_tree_pixel_test.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/test/pixel_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 software_output_device->set_surface_expansion_size( 46 software_output_device->set_surface_expansion_size(
47 surface_expansion_size); 47 surface_expansion_size);
48 output_surface = make_scoped_ptr( 48 output_surface = make_scoped_ptr(
49 new PixelTestOutputSurface( 49 new PixelTestOutputSurface(
50 software_output_device.PassAs<SoftwareOutputDevice>())); 50 software_output_device.PassAs<SoftwareOutputDevice>()));
51 break; 51 break;
52 } 52 }
53 53
54 case GL_WITH_DEFAULT: 54 case GL_WITH_DEFAULT:
55 case GL_WITH_BITMAP: { 55 case GL_WITH_BITMAP: {
56 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); 56 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL));
57 57
58 using webkit::gpu::ContextProviderInProcess; 58 using webkit::gpu::ContextProviderInProcess;
59 output_surface = make_scoped_ptr(new PixelTestOutputSurface( 59 output_surface = make_scoped_ptr(new PixelTestOutputSurface(
60 ContextProviderInProcess::CreateOffscreen())); 60 ContextProviderInProcess::CreateOffscreen()));
61 break; 61 break;
62 } 62 }
63 } 63 }
64 64
65 output_surface->set_viewport_offset(viewport_offset); 65 output_surface->set_viewport_offset(viewport_offset);
66 output_surface->set_surface_expansion_size(surface_expansion_size); 66 output_surface->set_surface_expansion_size(surface_expansion_size);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 TryEndTest(); 304 TryEndTest();
305 } 305 }
306 306
307 void LayerTreePixelTest::CopyBitmapToTextureMailboxAsTexture( 307 void LayerTreePixelTest::CopyBitmapToTextureMailboxAsTexture(
308 const SkBitmap& bitmap, 308 const SkBitmap& bitmap,
309 TextureMailbox* texture_mailbox, 309 TextureMailbox* texture_mailbox,
310 scoped_ptr<SingleReleaseCallback>* release_callback) { 310 scoped_ptr<SingleReleaseCallback>* release_callback) {
311 DCHECK_GT(bitmap.width(), 0); 311 DCHECK_GT(bitmap.width(), 0);
312 DCHECK_GT(bitmap.height(), 0); 312 DCHECK_GT(bitmap.height(), 0);
313 313
314 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); 314 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL));
315 315
316 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; 316 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
317 scoped_ptr<blink::WebGraphicsContext3D> context3d( 317 scoped_ptr<blink::WebGraphicsContext3D> context3d(
318 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( 318 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext(
319 blink::WebGraphicsContext3D::Attributes())); 319 blink::WebGraphicsContext3D::Attributes()));
320 320
321 EXPECT_TRUE(context3d->makeContextCurrent()); 321 EXPECT_TRUE(context3d->makeContextCurrent());
322 322
323 unsigned texture_id = context3d->createTexture(); 323 unsigned texture_id = context3d->createTexture();
324 context3d->bindTexture(GL_TEXTURE_2D, texture_id); 324 context3d->bindTexture(GL_TEXTURE_2D, texture_id);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(&context3d), 376 base::Passed(&context3d),
377 texture_id)); 377 texture_id));
378 } 378 }
379 379
380 } // namespace cc 380 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698