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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Issue 2443553002: Create correct GLES3 context for GLES3 unittest (Closed)
Patch Set: remove context_type since it is equivalent to enable_es3 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
index 5b0036a401f9ade9f75317bf615e5a3475166810..952fdb49ac999f4057b090500c317a296650dd4d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
@@ -79,7 +79,7 @@ TEST_P(GLES2DecoderTest, GenerateMipmapHandlesOutOfMemory) {
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
GLint width = 0;
GLint height = 0;
@@ -158,7 +158,7 @@ TEST_P(GLES3DecoderTest, GenerateMipmapBaseLevel) {
// Same as GenerateMipmapClearsUnclearedTexture, but with workaround
// |set_texture_filters_before_generating_mipmap|.
TEST_P(GLES2DecoderManualInitTest, SetTextureFiltersBeforeGenerateMipmap) {
- base::CommandLine command_line(0, NULL);
+ base::CommandLine command_line(0, nullptr);
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP));
@@ -673,7 +673,7 @@ TEST_P(GLES2DecoderTest, TexImage2DGLError) {
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_FALSE(
texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height, nullptr));
@@ -719,7 +719,7 @@ TEST_P(GLES2DecoderTest, CopyTexImage2DGLError) {
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_FALSE(
texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height, nullptr));
@@ -741,7 +741,7 @@ TEST_P(GLES2DecoderTest, CopyTexImage2DGLError) {
}
TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) {
- base::CommandLine command_line(0, NULL);
+ base::CommandLine command_line(0, nullptr);
command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
InitState init;
init.gl_version = "OpenGL ES 3.0";
@@ -832,7 +832,7 @@ TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) {
}
TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormatES3) {
- base::CommandLine command_line(0, NULL);
+ base::CommandLine command_line(0, nullptr);
command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
InitState init;
init.gl_version = "OpenGL ES 3.0";
@@ -940,7 +940,7 @@ TEST_P(GLES3DecoderTest, CompressedTexImage3DBucket) {
const GLsizei kDepth = 4;
const GLint kBorder = 0;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
const GLsizei kImageSize = 32;
bucket->SetSize(kImageSize);
@@ -987,7 +987,7 @@ TEST_P(GLES3DecoderTest, CompressedTexImage3DBucketBucketSizeIsZero) {
const GLsizei kDepth = 4;
const GLint kBorder = 0;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
const GLsizei kImageSize = 0;
bucket->SetSize(kImageSize);
@@ -1045,7 +1045,7 @@ TEST_P(GLES2DecoderTest, CompressedTexImage3DFailsOnES2) {
const GLsizei kHeight = 4;
const GLsizei kDepth = 4;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
const GLsizei kImageSize = 32;
bucket->SetSize(kImageSize);
@@ -1389,7 +1389,7 @@ TEST_P(GLES3DecoderTest, CopyTexSubImage3DClearTheUncleared3DTexture) {
kFormat, kType, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_FALSE(texture->SafeToRenderFrom());
@@ -1449,7 +1449,7 @@ TEST_P(GLES3DecoderTest, CompressedTexImage3DFailsWithBadImageSize) {
const GLsizei kHeight = 8;
const GLsizei kDepth = 4;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
const GLsizei kBadImageSize = 64;
bucket->SetSize(kBadImageSize);
@@ -1477,7 +1477,7 @@ TEST_P(GLES3DecoderTest, CompressedTexSubImage3DFails) {
const GLsizei kDepth = 4;
const GLint kBorder = 0;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
const GLsizei kImageSize = 128;
bucket->SetSize(kImageSize);
@@ -1662,7 +1662,7 @@ TEST_P(GLES3DecoderTest, CompressedTexImage2DBucketBucketSizeIsZero) {
const GLsizei kHeight = 4;
const GLint kBorder = 0;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
const GLsizei kImageSize = 0;
bucket->SetSize(kImageSize);
@@ -1753,7 +1753,7 @@ TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DS3TCWebGL) {
InitDecoder(init);
const uint32_t kBucketId = 123;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -1910,7 +1910,7 @@ TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) {
InitDecoder(init);
const uint32_t kBucketId = 123;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
+ ASSERT_TRUE(bucket != nullptr);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -2181,7 +2181,7 @@ TEST_P(GLES2DecoderManualInitTest, CompressedTexImage2DETC1) {
// Test TexSubImage not allowed for ETC1 compressed texture
TextureRef* texture_ref = GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
GLenum type, internal_format;
EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format));
@@ -2224,7 +2224,7 @@ TEST_P(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
TextureRef* texture_ref = GetTexture(kNewClientId);
- EXPECT_TRUE(texture_ref != NULL);
+ EXPECT_TRUE(texture_ref != nullptr);
EXPECT_TRUE(texture_ref->texture()->target() == GL_TEXTURE_EXTERNAL_OES);
}
@@ -2267,7 +2267,7 @@ TEST_P(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
TextureRef* texture_ref = GetTexture(client_texture_id_);
- EXPECT_TRUE(texture_ref != NULL);
+ EXPECT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES);
EXPECT_TRUE(texture->min_filter() == GL_LINEAR);
@@ -2315,7 +2315,7 @@ TEST_P(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
TextureRef* texture_ref = GetTexture(client_texture_id_);
- EXPECT_TRUE(texture_ref != NULL);
+ EXPECT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES);
EXPECT_TRUE(texture->min_filter() == GL_LINEAR);
@@ -2347,7 +2347,7 @@ TEST_P(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) {
EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
TextureRef* texture_ref = GetTexture(client_texture_id_);
- EXPECT_TRUE(texture_ref != NULL);
+ EXPECT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->target() == GL_TEXTURE_EXTERNAL_OES);
EXPECT_TRUE(texture->min_filter() == GL_LINEAR);
@@ -2370,7 +2370,7 @@ TEST_P(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) {
GLenum format = GL_RGBA;
GLenum type = GL_UNSIGNED_BYTE;
DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
- ASSERT_TRUE(GetTexture(client_texture_id_) != NULL);
+ ASSERT_TRUE(GetTexture(client_texture_id_) != nullptr);
TexImage2D cmd;
cmd.Init(target,
level,
@@ -2629,7 +2629,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
Texture* texture = GetTexture(kNewClientId)->texture();
- EXPECT_TRUE(texture != NULL);
+ EXPECT_TRUE(texture != nullptr);
EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB);
}
@@ -2672,7 +2672,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) {
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
Texture* texture = GetTexture(client_texture_id_)->texture();
- EXPECT_TRUE(texture != NULL);
+ EXPECT_TRUE(texture != nullptr);
EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB);
EXPECT_TRUE(texture->min_filter() == GL_LINEAR);
EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE);
@@ -2720,7 +2720,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
Texture* texture = GetTexture(client_texture_id_)->texture();
- EXPECT_TRUE(texture != NULL);
+ EXPECT_TRUE(texture != nullptr);
EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB);
EXPECT_TRUE(texture->min_filter() == GL_LINEAR);
EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE);
@@ -2752,7 +2752,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) {
EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
Texture* texture = GetTexture(client_texture_id_)->texture();
- EXPECT_TRUE(texture != NULL);
+ EXPECT_TRUE(texture != nullptr);
EXPECT_TRUE(texture->target() == GL_TEXTURE_RECTANGLE_ARB);
EXPECT_TRUE(texture->min_filter() == GL_LINEAR);
EXPECT_TRUE(texture->wrap_s() == GL_CLAMP_TO_EDGE);
@@ -2775,7 +2775,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2D) {
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
- ASSERT_TRUE(GetTexture(client_texture_id_) != NULL);
+ ASSERT_TRUE(GetTexture(client_texture_id_) != nullptr);
TexImage2D cmd;
cmd.Init(target,
@@ -2808,7 +2808,7 @@ TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DInvalid) {
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
- ASSERT_TRUE(GetTexture(client_texture_id_) != NULL);
+ ASSERT_TRUE(GetTexture(client_texture_id_) != nullptr);
TexImage2D cmd;
cmd.Init(target,
@@ -2917,7 +2917,7 @@ TEST_P(GLES2DecoderTest, TexSubImage2DDoesNotClearAfterTexImage2DNULLThenData) {
TEST_P(
GLES2DecoderManualInitTest,
TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster) {
- base::CommandLine command_line(0, NULL);
+ base::CommandLine command_line(0, nullptr);
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::TEXSUBIMAGE_FASTER_THAN_TEXIMAGE));
@@ -3031,7 +3031,7 @@ TEST_P(GLES2DecoderTest, CopyTexImage2DMarksTextureAsCleared) {
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_CALL(*gl_, GetError())
@@ -3077,7 +3077,7 @@ TEST_P(GLES2DecoderTest, CopyTexSubImage2DTwiceMarksTextureAsCleared) {
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->SafeToRenderFrom());
}
@@ -3114,7 +3114,7 @@ TEST_P(GLES2DecoderTest, CopyTexSubImage2DTwiceClearsUnclearedTexture) {
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->SafeToRenderFrom());
}
@@ -3134,7 +3134,7 @@ TEST_P(GLES2DecoderTest, CopyTexSubImage2DClearsUnclearedBackBufferSizedTexture)
TextureManager* manager = group().texture_manager();
TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->SafeToRenderFrom());
}
@@ -3193,7 +3193,7 @@ TEST_P(GLES2DecoderTest, ProduceAndConsumeTextureCHROMIUM) {
GL_TEXTURE_2D, 1, GL_RGBA, 2, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
@@ -3282,7 +3282,7 @@ TEST_P(GLES2DecoderTest, ProduceAndConsumeDirectTextureCHROMIUM) {
GL_TEXTURE_2D, 1, GL_RGBA, 2, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
@@ -3329,7 +3329,7 @@ TEST_P(GLES2DecoderTest, ProduceAndConsumeDirectTextureCHROMIUM) {
// Make sure the new client ID is associated with the produced service ID.
texture_ref = group().texture_manager()->GetTexture(new_texture_id);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
@@ -3362,7 +3362,7 @@ TEST_P(GLES2DecoderTest, ProduceTextureCHROMIUMInvalidTarget) {
GL_UNSIGNED_BYTE, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
@@ -3405,7 +3405,7 @@ TEST_P(GLES2DecoderTest, CreateAndConsumeTextureCHROMIUMInvalidMailbox) {
// CreateAndConsumeTexture failed.
TextureRef* texture_ref =
group().texture_manager()->GetTexture(new_texture_id);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
// New texture should have the correct target type.
EXPECT_TRUE(texture->target() == GL_TEXTURE_2D);
@@ -3419,7 +3419,7 @@ TEST_P(GLES2DecoderTest, CreateAndConsumeTextureCHROMIUMInvalidTarget) {
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
ProduceTextureDirectCHROMIUMImmediate& produce_cmd =
*GetImmediateAs<ProduceTextureDirectCHROMIUMImmediate>();
@@ -3453,7 +3453,7 @@ TEST_P(GLES2DecoderTest, CreateAndConsumeTextureCHROMIUMInvalidTarget) {
// Make sure the new client_id is associated with a texture ref even though
// CreateAndConsumeTexture failed.
texture_ref = group().texture_manager()->GetTexture(new_texture_id);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
// New texture should have the correct target type.
EXPECT_TRUE(texture->target() == GL_TEXTURE_CUBE_MAP);
@@ -3577,13 +3577,13 @@ TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUM) {
GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
scoped_refptr<gl::GLImage> image(new gl::GLImageStub);
GetImageManager()->AddImage(image.get(), 1);
- EXPECT_FALSE(GetImageManager()->LookupImage(1) == NULL);
+ EXPECT_FALSE(GetImageManager()->LookupImage(1) == nullptr);
GLsizei width;
GLsizei height;
@@ -3597,7 +3597,7 @@ TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUM) {
EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format));
EXPECT_EQ(static_cast<GLenum>(GL_RGBA), internal_format);
EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type);
- EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
// Bind image to texture.
// ScopedGLErrorSuppressor calls GetError on its constructor and destructor.
@@ -3605,7 +3605,7 @@ TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUM) {
EXPECT_TRUE(
texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
// Image should now be set.
- EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
// Define new texture image.
DoTexImage2D(
@@ -3613,7 +3613,7 @@ TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUM) {
EXPECT_TRUE(
texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
// Image should no longer be set.
- EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
}
TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUMCubeMapNotAllowed) {
@@ -3636,13 +3636,13 @@ TEST_P(GLES2DecoderTest, OrphanGLImageWithTexImage2D) {
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get());
DoTexImage2D(
GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
- EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
}
TEST_P(GLES2DecoderTest, GLImageAttachedAfterSubTexImage2D) {
@@ -3678,7 +3678,7 @@ TEST_P(GLES2DecoderTest, GLImageAttachedAfterSubTexImage2D) {
// Check binding.
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get());
@@ -3722,7 +3722,7 @@ TEST_P(GLES2DecoderTest, GLImageAttachedAfterClearLevel) {
// Check binding.
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get());
@@ -3745,13 +3745,13 @@ TEST_P(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) {
GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
scoped_refptr<gl::GLImage> image(new gl::GLImageStub);
GetImageManager()->AddImage(image.get(), 1);
- EXPECT_FALSE(GetImageManager()->LookupImage(1) == NULL);
+ EXPECT_FALSE(GetImageManager()->LookupImage(1) == nullptr);
GLsizei width;
GLsizei height;
@@ -3765,7 +3765,7 @@ TEST_P(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) {
EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format));
EXPECT_EQ(static_cast<GLenum>(GL_RGBA), internal_format);
EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type);
- EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
// Bind image to texture.
// ScopedGLErrorSuppressor calls GetError on its constructor and destructor.
@@ -3773,7 +3773,7 @@ TEST_P(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) {
EXPECT_TRUE(
texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
// Image should now be set.
- EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
// Release image from texture.
// ScopedGLErrorSuppressor calls GetError on its constructor and destructor.
@@ -3787,7 +3787,7 @@ TEST_P(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) {
EXPECT_TRUE(
texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
// Image should no longer be set.
- EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
+ EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == nullptr);
}
class MockGLImage : public gl::GLImage {
@@ -3833,7 +3833,7 @@ TEST_P(GLES2DecoderWithShaderTest, CopyTexImage) {
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_EQ(kServiceTextureId, texture->service_id());
@@ -4001,10 +4001,13 @@ TEST_P(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) {
}
TEST_P(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) {
+ base::CommandLine command_line(0, nullptr);
+ command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
InitState init;
init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
init.gl_version = "opengl es 3.0";
- InitDecoder(init);
+ init.context_type = CONTEXT_TYPE_OPENGLES3;
+ InitDecoderWithCommandLine(init, &command_line);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
@@ -4026,10 +4029,13 @@ TEST_P(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) {
}
TEST_P(GLES2DecoderManualInitTest, TexSubImage2DFloatOnGLES3) {
+ base::CommandLine command_line(0, nullptr);
+ command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
InitState init;
init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
init.gl_version = "opengl es 3.0";
- InitDecoder(init);
+ init.context_type = CONTEXT_TYPE_OPENGLES3;
+ InitDecoderWithCommandLine(init, &command_line);
const int kWidth = 8;
const int kHeight = 4;
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -4072,10 +4078,13 @@ TEST_P(GLES2DecoderManualInitTest, TexSubImage2DFloatOnGLES3) {
}
TEST_P(GLES2DecoderManualInitTest, TexSubImage2DFloatDoesClearOnGLES3) {
+ base::CommandLine command_line(0, nullptr);
+ command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
Zhenyao Mo 2016/11/01 22:28:45 Qiankun: sorry about this, but we are in the proce
qiankun 2016/11/02 01:43:14 So, we are not able to add new ES3 tests and fix b
InitState init;
init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
init.gl_version = "opengl es 3.0";
- InitDecoder(init);
+ init.context_type = CONTEXT_TYPE_OPENGLES3;
+ InitDecoderWithCommandLine(init, &command_line);
const int kWidth = 8;
const int kHeight = 4;
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -4380,7 +4389,7 @@ TEST_P(GLES3DecoderTest, ClearLevel3DSingleCall) {
kFormat, kType, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_CALL(*gl_, GenBuffersARB(1, _))
@@ -4434,7 +4443,7 @@ TEST_P(GLES3DecoderTest, ClearLevel3DMultipleLayersPerCall) {
kFormat, kType, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_CALL(*gl_, GenBuffersARB(1, _))
@@ -4499,7 +4508,7 @@ TEST_P(GLES3DecoderTest, ClearLevel3DMultipleCallsPerLayer) {
kFormat, kType, 0, 0);
TextureRef* texture_ref =
group().texture_manager()->GetTexture(client_texture_id_);
- ASSERT_TRUE(texture_ref != NULL);
+ ASSERT_TRUE(texture_ref != nullptr);
Texture* texture = texture_ref->texture();
EXPECT_CALL(*gl_, GenBuffersARB(1, _))
@@ -4585,7 +4594,7 @@ TEST_P(GLES2DecoderWithShaderTest, CHROMIUMImageEmulatingRGB) {
else
image = new gl::GLImageStub;
GetImageManager()->AddImage(image.get(), image_id);
- EXPECT_FALSE(GetImageManager()->LookupImage(image_id) == NULL);
+ EXPECT_FALSE(GetImageManager()->LookupImage(image_id) == nullptr);
DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id);
@@ -4663,7 +4672,7 @@ TEST_P(GLES2DecoderTest, BindTextureValidArgsNewId) {
cmd.Init(GL_TEXTURE_2D, kNewClientId);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- EXPECT_TRUE(GetTexture(kNewClientId) != NULL);
+ EXPECT_TRUE(GetTexture(kNewClientId) != nullptr);
}
TEST_P(GLES2DecoderTest, BindTextureInvalidArgs) {

Powered by Google App Engine
This is Rietveld 408576698