Chromium Code Reviews| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 GL_RGBA, | 212 GL_RGBA, |
| 213 GL_UNSIGNED_BYTE, | 213 GL_UNSIGNED_BYTE, |
| 214 kSharedMemoryId, | 214 kSharedMemoryId, |
| 215 kSharedMemoryOffset, | 215 kSharedMemoryOffset, |
| 216 GL_FALSE); | 216 GL_FALSE); |
| 217 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 217 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 218 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 218 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 219 } | 219 } |
| 220 | 220 |
| 221 TEST_P(GLES2DecoderTest, TexSubImage2DBadArgs) { | 221 TEST_P(GLES2DecoderTest, TexSubImage2DBadArgs) { |
| 222 const int kWidth = 16; | 222 const int kWidth = 8; |
| 223 const int kHeight = 8; | 223 const int kHeight = 4; |
|
bajones
2015/10/28 20:23:26
What necessitated this change?
Kimmo Kinnunen
2015/10/29 06:21:17
Explained already in the commit message. The data
| |
| 224 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 224 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 225 DoTexImage2D(GL_TEXTURE_2D, | 225 DoTexImage2D(GL_TEXTURE_2D, |
| 226 1, | 226 1, |
| 227 GL_RGBA, | 227 GL_RGBA, |
| 228 kWidth, | 228 kWidth, |
| 229 kHeight, | 229 kHeight, |
| 230 0, | 230 0, |
| 231 GL_RGBA, | 231 GL_RGBA, |
| 232 GL_UNSIGNED_BYTE, | 232 GL_UNSIGNED_BYTE, |
| 233 0, | 233 0, |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 259 GL_FALSE); | 259 GL_FALSE); |
| 260 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 260 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 261 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 261 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 262 cmd.Init(GL_TEXTURE_2D, | 262 cmd.Init(GL_TEXTURE_2D, |
| 263 1, | 263 1, |
| 264 0, | 264 0, |
| 265 0, | 265 0, |
| 266 kWidth, | 266 kWidth, |
| 267 kHeight, | 267 kHeight, |
| 268 GL_RGBA, | 268 GL_RGBA, |
| 269 GL_UNSIGNED_INT, | 269 GL_UNSIGNED_INT, |
|
Kimmo Kinnunen
2015/10/29 06:21:17
This is the case that would fail with oob when the
| |
| 270 kSharedMemoryId, | 270 kSharedMemoryId, |
| 271 kSharedMemoryOffset, | 271 kSharedMemoryOffset, |
| 272 GL_FALSE); | 272 GL_FALSE); |
| 273 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 273 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 274 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 274 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 275 cmd.Init(GL_TEXTURE_2D, | 275 cmd.Init(GL_TEXTURE_2D, |
| 276 1, | 276 1, |
| 277 -1, | 277 -1, |
| 278 0, | 278 0, |
| 279 kWidth, | 279 kWidth, |
| (...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3363 // TODO(gman): CompressedTexSubImage2DImmediate | 3363 // TODO(gman): CompressedTexSubImage2DImmediate |
| 3364 | 3364 |
| 3365 // TODO(gman): TexImage2D | 3365 // TODO(gman): TexImage2D |
| 3366 | 3366 |
| 3367 // TODO(gman): TexImage2DImmediate | 3367 // TODO(gman): TexImage2DImmediate |
| 3368 | 3368 |
| 3369 // TODO(gman): TexSubImage2DImmediate | 3369 // TODO(gman): TexSubImage2DImmediate |
| 3370 | 3370 |
| 3371 } // namespace gles2 | 3371 } // namespace gles2 |
| 3372 } // namespace gpu | 3372 } // namespace gpu |
| OLD | NEW |