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

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

Issue 98643013: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clarify code in generate_bindings.py according to feedback Created 6 years, 11 months 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') | ui/gl/generate_bindings.py » ('J')
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/test/pixel_test.cc » ('j') | ui/gl/generate_bindings.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698