| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "testing/gmock/include/gmock/gmock.h" | 5 #include "testing/gmock/include/gmock/gmock.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 #include <EGL/egl.h> | 8 #include <EGL/egl.h> |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 | 10 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 468 |
| 469 // Command buffer limitation: | 469 // Command buffer limitation: |
| 470 // Different read and draw surfaces fail. | 470 // Different read and draw surfaces fail. |
| 471 EXPECT_FALSE(eglMakeCurrent(display_, surface1_, surface2_, context1_)); | 471 EXPECT_FALSE(eglMakeCurrent(display_, surface1_, surface2_, context1_)); |
| 472 EXPECT_EQ(EGL_BAD_MATCH, eglGetError()); | 472 EXPECT_EQ(EGL_BAD_MATCH, eglGetError()); |
| 473 } | 473 } |
| 474 | 474 |
| 475 TEST_F(EGLMultipleSurfacesContextsTest, CallGLOnMultipleContextNoCrash) { | 475 TEST_F(EGLMultipleSurfacesContextsTest, CallGLOnMultipleContextNoCrash) { |
| 476 EXPECT_TRUE(eglMakeCurrent(display_, surface1_, surface1_, context1_)); | 476 EXPECT_TRUE(eglMakeCurrent(display_, surface1_, surface1_, context1_)); |
| 477 | 477 |
| 478 typedef GL_APICALL void(GL_APIENTRY * glEnableProc)(GLenum); | 478 typedef void(GL_APIENTRY * glEnableProc)(GLenum); |
| 479 glEnableProc glEnable = | 479 glEnableProc glEnable = |
| 480 reinterpret_cast<glEnableProc>(eglGetProcAddress("glEnable")); | 480 reinterpret_cast<glEnableProc>(eglGetProcAddress("glEnable")); |
| 481 EXPECT_NE(nullptr, glEnable); | 481 EXPECT_NE(nullptr, glEnable); |
| 482 | 482 |
| 483 glEnable(GL_BLEND); | 483 glEnable(GL_BLEND); |
| 484 | 484 |
| 485 EXPECT_TRUE(eglMakeCurrent(display_, surface2_, surface2_, context2_)); | 485 EXPECT_TRUE(eglMakeCurrent(display_, surface2_, surface2_, context2_)); |
| 486 glEnable(GL_BLEND); | 486 glEnable(GL_BLEND); |
| 487 } | 487 } |
| 488 | 488 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 EXPECT_TRUE(result); | 585 EXPECT_TRUE(result); |
| 586 | 586 |
| 587 EXPECT_FALSE(eglMakeCurrent(display_, surface, surface, context)); | 587 EXPECT_FALSE(eglMakeCurrent(display_, surface, surface, context)); |
| 588 EXPECT_EQ(EGL_BAD_ACCESS, eglGetError()); | 588 EXPECT_EQ(EGL_BAD_ACCESS, eglGetError()); |
| 589 | 589 |
| 590 EXPECT_TRUE(eglDestroySurface(display_, surface)); | 590 EXPECT_TRUE(eglDestroySurface(display_, surface)); |
| 591 EXPECT_TRUE(eglDestroyContext(display_, context)); | 591 EXPECT_TRUE(eglDestroyContext(display_, context)); |
| 592 } | 592 } |
| 593 | 593 |
| 594 } // namespace gpu | 594 } // namespace gpu |
| OLD | NEW |