| OLD | NEW |
| 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 | 7 |
| 8 #include "gpu/command_buffer/tests/gl_manager.h" | 8 #include "gpu/command_buffer/tests/gl_manager.h" |
| 9 #include "gpu/command_buffer/tests/gl_test_utils.h" | 9 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 GLuint fbo_; | 44 GLuint fbo_; |
| 45 bool extension_available_; | 45 bool extension_available_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 TEST_F(TextureStorageTest, CorrectPixels) { | 48 TEST_F(TextureStorageTest, CorrectPixels) { |
| 49 if (!extension_available_) | 49 if (!extension_available_) |
| 50 return; | 50 return; |
| 51 | 51 |
| 52 glTexStorage2DEXT(GL_TEXTURE_2D, 2, GL_RGBA8_OES, 2, 2); | 52 glTexStorage2DEXT(GL_TEXTURE_2D, 2, GL_RGBA8_OES, 2, 2); |
| 53 | 53 |
| 54 // Mesa dirvers crash without rebinding to FBO. It's why |
| 55 // DISABLE_TEXTURE_STORAGE workaround is introduced. crbug.com/521904 |
| 56 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 57 tex_, 0); |
| 58 |
| 54 uint8 source_pixels[16] = { | 59 uint8 source_pixels[16] = { |
| 55 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 | 60 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 |
| 56 }; | 61 }; |
| 57 glTexSubImage2D(GL_TEXTURE_2D, | 62 glTexSubImage2D(GL_TEXTURE_2D, |
| 58 0, | 63 0, |
| 59 0, 0, | 64 0, 0, |
| 60 2, 2, | 65 2, 2, |
| 61 GL_RGBA, GL_UNSIGNED_BYTE, | 66 GL_RGBA, GL_UNSIGNED_BYTE, |
| 62 source_pixels); | 67 source_pixels); |
| 63 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 2, 2, 0, source_pixels)); | 68 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 2, 2, 0, source_pixels)); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 GL_RGBA, | 154 GL_RGBA, |
| 150 GL_UNSIGNED_BYTE, | 155 GL_UNSIGNED_BYTE, |
| 151 NULL); | 156 NULL); |
| 152 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_OPERATION), glGetError()); | 157 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_OPERATION), glGetError()); |
| 153 } | 158 } |
| 154 | 159 |
| 155 } // namespace gpu | 160 } // namespace gpu |
| 156 | 161 |
| 157 | 162 |
| 158 | 163 |
| OLD | NEW |