| 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 10 #include "gpu/command_buffer/tests/gl_manager.h" | 12 #include "gpu/command_buffer/tests/gl_manager.h" |
| 11 #include "gpu/command_buffer/tests/gl_test_utils.h" | 13 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 12 #include "gpu/config/gpu_switches.h" | 14 #include "gpu/config/gpu_switches.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 16 |
| 15 namespace gpu { | 17 namespace gpu { |
| 16 | 18 |
| 17 namespace { | 19 namespace { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 texture_, 0); | 130 texture_, 0); |
| 129 | 131 |
| 130 // force_cube_map_positive_x_allocation workaround prevents Nexus 5 crash. | 132 // force_cube_map_positive_x_allocation workaround prevents Nexus 5 crash. |
| 131 // TODO(dshwang): remove the workaround when it's fixed. crbug.com/518889 | 133 // TODO(dshwang): remove the workaround when it's fixed. crbug.com/518889 |
| 132 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); | 134 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); |
| 133 | 135 |
| 134 // Check that FB is not complete. | 136 // Check that FB is not complete. |
| 135 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT), | 137 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT), |
| 136 glCheckFramebufferStatus(GL_FRAMEBUFFER)); | 138 glCheckFramebufferStatus(GL_FRAMEBUFFER)); |
| 137 GLsizei size = width_ * width_ * 4; | 139 GLsizei size = width_ * width_ * 4; |
| 138 scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); | 140 std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); |
| 139 glReadPixels(0, 0, width_, width_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); | 141 glReadPixels(0, 0, width_, width_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); |
| 140 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_FRAMEBUFFER_OPERATION), | 142 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_FRAMEBUFFER_OPERATION), |
| 141 glGetError()); | 143 glGetError()); |
| 142 } | 144 } |
| 143 | 145 |
| 144 } // namespace gpu | 146 } // namespace gpu |
| OLD | NEW |