| 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 11 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 12 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 13 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 12 #include "gpu/command_buffer/service/context_group.h" | 14 #include "gpu/command_buffer/service/context_group.h" |
| 13 #include "gpu/command_buffer/service/context_state.h" | 15 #include "gpu/command_buffer/service/context_state.h" |
| 14 #include "gpu/command_buffer/service/gl_surface_mock.h" | 16 #include "gpu/command_buffer/service/gl_surface_mock.h" |
| 15 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" | 17 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" |
| 16 | 18 |
| (...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 static const GLenum faces[] = { | 2053 static const GLenum faces[] = { |
| 2052 GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, | 2054 GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, |
| 2053 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, | 2055 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, |
| 2054 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, | 2056 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, |
| 2055 }; | 2057 }; |
| 2056 SetupCubemapProgram(); | 2058 SetupCubemapProgram(); |
| 2057 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId); | 2059 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId); |
| 2058 // Fill out all the faces for 2 levels, leave 2 uncleared. | 2060 // Fill out all the faces for 2 levels, leave 2 uncleared. |
| 2059 for (int ii = 0; ii < 6; ++ii) { | 2061 for (int ii = 0; ii < 6; ++ii) { |
| 2060 GLenum face = faces[ii]; | 2062 GLenum face = faces[ii]; |
| 2061 int32 shm_id = | 2063 int32_t shm_id = |
| 2062 (face == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ? 0 : kSharedMemoryId; | 2064 (face == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ? 0 : kSharedMemoryId; |
| 2063 uint32 shm_offset = | 2065 uint32_t shm_offset = |
| 2064 (face == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ? 0 : kSharedMemoryOffset; | 2066 (face == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ? 0 : kSharedMemoryOffset; |
| 2065 DoTexImage2D(face, | 2067 DoTexImage2D(face, |
| 2066 0, | 2068 0, |
| 2067 GL_RGBA, | 2069 GL_RGBA, |
| 2068 2, | 2070 2, |
| 2069 2, | 2071 2, |
| 2070 0, | 2072 0, |
| 2071 GL_RGBA, | 2073 GL_RGBA, |
| 2072 GL_UNSIGNED_BYTE, | 2074 GL_UNSIGNED_BYTE, |
| 2073 shm_id, | 2075 shm_id, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2320 .Times(1) | 2322 .Times(1) |
| 2321 .RetiresOnSaturation(); | 2323 .RetiresOnSaturation(); |
| 2322 DrawArrays cmd; | 2324 DrawArrays cmd; |
| 2323 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 2325 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
| 2324 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 2326 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2325 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2327 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2326 } | 2328 } |
| 2327 | 2329 |
| 2328 } // namespace gles2 | 2330 } // namespace gles2 |
| 2329 } // namespace gpu | 2331 } // namespace gpu |
| OLD | NEW |