| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 3338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3349 | 3349 |
| 3350 result->size = 0; | 3350 result->size = 0; |
| 3351 cmd.Init( | 3351 cmd.Init( |
| 3352 GL_COMPRESSED_TEXTURE_FORMATS, shared_memory_id_, shared_memory_offset_); | 3352 GL_COMPRESSED_TEXTURE_FORMATS, shared_memory_id_, shared_memory_offset_); |
| 3353 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 3353 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 3354 EXPECT_EQ(num_formats, result->GetNumResults()); | 3354 EXPECT_EQ(num_formats, result->GetNumResults()); |
| 3355 | 3355 |
| 3356 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3356 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3357 } | 3357 } |
| 3358 | 3358 |
| 3359 TEST_P(GLES3DecoderTest, TexStorage3DValidArgs) { |
| 3360 DoBindTexture(GL_TEXTURE_3D, client_texture_id_, kServiceTextureId); |
| 3361 EXPECT_CALL(*gl_, TexStorage3D(GL_TEXTURE_3D, 2, GL_RGB565, 4, 5, 6)) |
| 3362 .Times(1) |
| 3363 .RetiresOnSaturation(); |
| 3364 EXPECT_CALL(*gl_, GetError()) |
| 3365 .WillOnce(Return(GL_NO_ERROR)) |
| 3366 .WillOnce(Return(GL_NO_ERROR)) |
| 3367 .RetiresOnSaturation(); |
| 3368 cmds::TexStorage3D cmd; |
| 3369 cmd.Init(GL_TEXTURE_3D, 2, GL_RGB565, 4, 5, 6); |
| 3370 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 3371 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3372 } |
| 3373 |
| 3374 TEST_P(GLES3DecoderTest, TexImage3DValidArgs) { |
| 3375 const GLenum kTarget = GL_TEXTURE_3D; |
| 3376 const GLint kLevel = 2; |
| 3377 const GLint kInternalFormat = GL_RGBA8; |
| 3378 const GLsizei kWidth = 2; |
| 3379 const GLsizei kHeight = 2; |
| 3380 const GLsizei kDepth = 2; |
| 3381 const GLenum kFormat = GL_RGBA; |
| 3382 const GLenum kType = GL_UNSIGNED_BYTE; |
| 3383 |
| 3384 DoBindTexture(GL_TEXTURE_3D, client_texture_id_, kServiceTextureId); |
| 3385 DoTexImage3D(kTarget, kLevel, kInternalFormat, kWidth, kHeight, kDepth, 0, |
| 3386 kFormat, kType, kSharedMemoryId, kSharedMemoryOffset); |
| 3387 } |
| 3388 |
| 3359 // TODO(gman): Complete this test. | 3389 // TODO(gman): Complete this test. |
| 3360 // TEST_P(GLES2DecoderTest, CompressedTexImage2DGLError) { | 3390 // TEST_P(GLES2DecoderTest, CompressedTexImage2DGLError) { |
| 3361 // } | 3391 // } |
| 3362 | 3392 |
| 3363 // TODO(gman): CompressedTexImage2D | 3393 // TODO(gman): CompressedTexImage2D |
| 3364 | 3394 |
| 3365 // TODO(gman): CompressedTexImage2DImmediate | 3395 // TODO(gman): CompressedTexImage2DImmediate |
| 3366 | 3396 |
| 3367 // TODO(gman): CompressedTexSubImage2DImmediate | 3397 // TODO(gman): CompressedTexSubImage2DImmediate |
| 3368 | 3398 |
| 3369 // TODO(gman): TexImage2D | 3399 // TODO(gman): TexImage2D |
| 3370 | 3400 |
| 3371 // TODO(gman): TexImage2DImmediate | 3401 // TODO(gman): TexImage2DImmediate |
| 3372 | 3402 |
| 3373 // TODO(gman): TexSubImage2DImmediate | 3403 // TODO(gman): TexSubImage2DImmediate |
| 3374 | 3404 |
| 3375 } // namespace gles2 | 3405 } // namespace gles2 |
| 3376 } // namespace gpu | 3406 } // namespace gpu |
| OLD | NEW |