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

Side by Side Diff: gpu/command_buffer/tests/gl_texture_mailbox_unittest.cc

Issue 1474873003: Add alpha argument to glResizeCHROMIUM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 8
9 #include "gpu/command_buffer/client/gles2_lib.h" 9 #include "gpu/command_buffer/client/gles2_lib.h"
10 #include "gpu/command_buffer/common/mailbox.h" 10 #include "gpu/command_buffer/common/mailbox.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 gl2_.decoder()->ProduceFrontBuffer(mailbox); 334 gl2_.decoder()->ProduceFrontBuffer(mailbox);
335 335
336 gl1_.MakeCurrent(); 336 gl1_.MakeCurrent();
337 GLuint tex1; 337 GLuint tex1;
338 glGenTextures(1, &tex1); 338 glGenTextures(1, &tex1);
339 glBindTexture(GL_TEXTURE_2D, tex1); 339 glBindTexture(GL_TEXTURE_2D, tex1);
340 glConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 340 glConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
341 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 341 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
342 342
343 gl2_.MakeCurrent(); 343 gl2_.MakeCurrent();
344 glResizeCHROMIUM(10, 10, 1); 344 glResizeCHROMIUM(10, 10, 1, true);
345 glClearColor(1, 0, 0, 1); 345 glClearColor(1, 0, 0, 1);
346 glClear(GL_COLOR_BUFFER_BIT); 346 glClear(GL_COLOR_BUFFER_BIT);
347 ::gles2::GetGLContext()->SwapBuffers(); 347 ::gles2::GetGLContext()->SwapBuffers();
348 348
349 gl1_.MakeCurrent(); 349 gl1_.MakeCurrent();
350 EXPECT_EQ(0xFF0000FFu, ReadTexel(tex1, 0, 0)); 350 EXPECT_EQ(0xFF0000FFu, ReadTexel(tex1, 0, 0));
351 EXPECT_EQ(0xFF0000FFu, ReadTexel(tex1, 9, 9)); 351 EXPECT_EQ(0xFF0000FFu, ReadTexel(tex1, 9, 9));
352 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 352 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
353 353
354 gl2_.MakeCurrent(); 354 gl2_.MakeCurrent();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 gl1_.MakeCurrent(); 424 gl1_.MakeCurrent();
425 for (size_t i = 0; i < 2; ++i) { 425 for (size_t i = 0; i < 2; ++i) {
426 glBindTexture(GL_TEXTURE_2D, tex[i]); 426 glBindTexture(GL_TEXTURE_2D, tex[i]);
427 glConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox[i].name); 427 glConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox[i].name);
428 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 428 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
429 } 429 }
430 430
431 for (size_t i = 0; i < 2; ++i) { 431 for (size_t i = 0; i < 2; ++i) {
432 other_gl[i].MakeCurrent(); 432 other_gl[i].MakeCurrent();
433 glResizeCHROMIUM(10, 10, 1); 433 glResizeCHROMIUM(10, 10, 1, true);
434 glClearColor(1-i%2, i%2, 0, 1); 434 glClearColor(1-i%2, i%2, 0, 1);
435 glClear(GL_COLOR_BUFFER_BIT); 435 glClear(GL_COLOR_BUFFER_BIT);
436 ::gles2::GetGLContext()->SwapBuffers(); 436 ::gles2::GetGLContext()->SwapBuffers();
437 } 437 }
438 438
439 gl1_.MakeCurrent(); 439 gl1_.MakeCurrent();
440 EXPECT_EQ(0xFF0000FFu, ReadTexel(tex[0], 0, 0)); 440 EXPECT_EQ(0xFF0000FFu, ReadTexel(tex[0], 0, 0));
441 EXPECT_EQ(0xFF00FF00u, ReadTexel(tex[1], 9, 9)); 441 EXPECT_EQ(0xFF00FF00u, ReadTexel(tex[1], 9, 9));
442 442
443 for (size_t i = 0; i < 2; ++i) { 443 for (size_t i = 0; i < 2; ++i) {
444 other_gl[i].MakeCurrent(); 444 other_gl[i].MakeCurrent();
445 other_gl[i].Destroy(); 445 other_gl[i].Destroy();
446 } 446 }
447 447
448 gl1_.MakeCurrent(); 448 gl1_.MakeCurrent();
449 glDeleteTextures(2, tex); 449 glDeleteTextures(2, tex);
450 } 450 }
451 #endif 451 #endif
452 452
453 } // namespace gpu 453 } // namespace gpu
454 454
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_test_autogen.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698