Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Issue 2751553002: Check for invalid dimensions in glTexStorage* (Closed)
Patch Set: comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after
4356 init.bind_generates_resource = true; 4356 init.bind_generates_resource = true;
4357 InitDecoder(init); 4357 InitDecoder(init);
4358 DoBindTexture(GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, 4358 DoBindTexture(GL_TEXTURE_RECTANGLE_ARB, client_texture_id_,
4359 kServiceTextureId); 4359 kServiceTextureId);
4360 TexStorage2DEXT cmd; 4360 TexStorage2DEXT cmd;
4361 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, 2, GL_RGBA8, 4, 4); 4361 cmd.Init(GL_TEXTURE_RECTANGLE_ARB, 2, GL_RGBA8, 4, 4);
4362 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 4362 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4363 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); 4363 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4364 } 4364 }
4365 4365
4366 TEST_P(GLES2DecoderManualInitTest, TexStorageInvalidSize) {
4367 InitState init;
4368 init.gl_version = "OpenGL 4.2";
4369 init.extensions = "GL_ARB_texture_storage";
4370 init.bind_generates_resource = true;
4371 InitDecoder(init);
4372 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
4373 {
4374 TexStorage2DEXT cmd;
4375 cmd.Init(GL_TEXTURE_2D, 1, GL_RGBA8, 0, 4);
4376 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4377 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4378 }
4379 {
4380 TexStorage2DEXT cmd;
4381 cmd.Init(GL_TEXTURE_2D, 1, GL_RGBA8, 4, 0);
4382 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4383 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4384 }
4385 {
4386 TexStorage2DEXT cmd;
4387 cmd.Init(GL_TEXTURE_2D, 1, GL_RGBA8, 0, 0);
4388 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4389 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4390 }
4391 }
4392
4366 class GLES2DecoderTexStorageFormatAndTypeTest 4393 class GLES2DecoderTexStorageFormatAndTypeTest
4367 : public GLES2DecoderManualInitTest { 4394 : public GLES2DecoderManualInitTest {
4368 public: 4395 public:
4369 GLES2DecoderTexStorageFormatAndTypeTest() {} 4396 GLES2DecoderTexStorageFormatAndTypeTest() {}
4370 4397
4371 void DoTexStorageFormatAndType(const InitState& init, 4398 void DoTexStorageFormatAndType(const InitState& init,
4372 GLenum format, 4399 GLenum format,
4373 GLenum adjusted_internal_format) { 4400 GLenum adjusted_internal_format) {
4374 InitDecoder(init); 4401 InitDecoder(init);
4375 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 4402 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
4843 // TODO(gman): CompressedTexSubImage2DImmediate 4870 // TODO(gman): CompressedTexSubImage2DImmediate
4844 4871
4845 // TODO(gman): TexImage2D 4872 // TODO(gman): TexImage2D
4846 4873
4847 // TODO(gman): TexImage2DImmediate 4874 // TODO(gman): TexImage2DImmediate
4848 4875
4849 // TODO(gman): TexSubImage2DImmediate 4876 // TODO(gman): TexSubImage2DImmediate
4850 4877
4851 } // namespace gles2 4878 } // namespace gles2
4852 } // namespace gpu 4879 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698