Commit e81fe436 authored by shrekshao's avatar shrekshao Committed by Commit Bot

Set extension_flags for oes_draw_buffers_indexed func

TBR=kbr@chromium.org

Bug: 1058744, 1085704, 1085846
Change-Id: Ia268bfe248a8fa7caa832e9e696a8039c7605b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214611Reviewed-by: default avatarShrek Shao <shrekshao@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Cr-Commit-Position: refs/heads/master@{#771483}
parent 994cac50
......@@ -1843,6 +1843,8 @@ _FUNCTION_INFO = {
'expectation': False,
},
'ColorMaskiOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'unit_test': False,
'extension': 'OES_draw_buffers_indexed',
},
'ContextVisibilityHintCHROMIUM': {
......@@ -1972,6 +1974,8 @@ _FUNCTION_INFO = {
},
},
'BlendEquationiOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'unit_test': False,
'extension': 'OES_draw_buffers_indexed',
'valid_args': {
'1': 'GL_FUNC_SUBTRACT',
......@@ -1986,6 +1990,8 @@ _FUNCTION_INFO = {
},
},
'BlendEquationSeparateiOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'unit_test': False,
'extension': 'OES_draw_buffers_indexed',
'valid_args': {
'1': 'GL_FUNC_SUBTRACT',
......@@ -1997,6 +2003,8 @@ _FUNCTION_INFO = {
'state': 'BlendFunc',
},
'BlendFunciOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'unit_test': False,
'extension': 'OES_draw_buffers_indexed',
},
'BlendFuncSeparate': {
......@@ -2004,6 +2012,8 @@ _FUNCTION_INFO = {
'state': 'BlendFunc',
},
'BlendFuncSeparateiOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'unit_test': False,
'extension': 'OES_draw_buffers_indexed',
},
'BlendBarrierKHR': {
......@@ -2117,6 +2127,7 @@ _FUNCTION_INFO = {
'client_test': False,
},
'DisableiOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'extension': 'OES_draw_buffers_indexed',
'decoder_func': 'DoDisableiOES',
'impl_func': False,
......@@ -2183,6 +2194,7 @@ _FUNCTION_INFO = {
'client_test': False,
},
'EnableiOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'extension': 'OES_draw_buffers_indexed',
'decoder_func': 'DoEnableiOES',
'impl_func': False,
......@@ -2780,6 +2792,8 @@ _FUNCTION_INFO = {
'expectation': False,
},
'IsEnablediOES': {
'extension_flag': 'oes_draw_buffers_indexed',
'unit_test': False,
'extension': 'OES_draw_buffers_indexed',
'type': 'Is',
'decoder_func': 'DoIsEnablediOES',
......
......@@ -5658,6 +5658,10 @@ error::Error GLES2DecoderImpl::HandleEnableiOES(uint32_t immediate_data_size,
const volatile void* cmd_data) {
const volatile gles2::cmds::EnableiOES& c =
*static_cast<const volatile gles2::cmds::EnableiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
DoEnableiOES(target, index);
......@@ -5669,6 +5673,10 @@ error::Error GLES2DecoderImpl::HandleDisableiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::DisableiOES& c =
*static_cast<const volatile gles2::cmds::DisableiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
DoDisableiOES(target, index);
......@@ -5680,6 +5688,10 @@ error::Error GLES2DecoderImpl::HandleBlendEquationiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::BlendEquationiOES& c =
*static_cast<const volatile gles2::cmds::BlendEquationiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum mode = static_cast<GLenum>(c.mode);
api()->glBlendEquationiOESFn(buf, mode);
......@@ -5692,6 +5704,10 @@ error::Error GLES2DecoderImpl::HandleBlendEquationSeparateiOES(
const volatile gles2::cmds::BlendEquationSeparateiOES& c =
*static_cast<const volatile gles2::cmds::BlendEquationSeparateiOES*>(
cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum modeRGB = static_cast<GLenum>(c.modeRGB);
GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha);
......@@ -5704,6 +5720,10 @@ error::Error GLES2DecoderImpl::HandleBlendFunciOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::BlendFunciOES& c =
*static_cast<const volatile gles2::cmds::BlendFunciOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum src = static_cast<GLenum>(c.src);
GLenum dst = static_cast<GLenum>(c.dst);
......@@ -5717,6 +5737,10 @@ error::Error GLES2DecoderImpl::HandleBlendFuncSeparateiOES(
const volatile gles2::cmds::BlendFuncSeparateiOES& c =
*static_cast<const volatile gles2::cmds::BlendFuncSeparateiOES*>(
cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum srcRGB = static_cast<GLenum>(c.srcRGB);
GLenum dstRGB = static_cast<GLenum>(c.dstRGB);
......@@ -5731,6 +5755,10 @@ error::Error GLES2DecoderImpl::HandleColorMaskiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::ColorMaskiOES& c =
*static_cast<const volatile gles2::cmds::ColorMaskiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLboolean r = static_cast<GLboolean>(c.r);
GLboolean g = static_cast<GLboolean>(c.g);
......@@ -5745,6 +5773,10 @@ error::Error GLES2DecoderImpl::HandleIsEnablediOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::IsEnablediOES& c =
*static_cast<const volatile gles2::cmds::IsEnablediOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
typedef cmds::IsEnablediOES::Result Result;
......
......@@ -4924,6 +4924,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleEnableiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::EnableiOES& c =
*static_cast<const volatile gles2::cmds::EnableiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
error::Error error = DoEnableiOES(target, index);
......@@ -4938,6 +4942,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleDisableiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::DisableiOES& c =
*static_cast<const volatile gles2::cmds::DisableiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
error::Error error = DoDisableiOES(target, index);
......@@ -4952,6 +4960,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleBlendEquationiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::BlendEquationiOES& c =
*static_cast<const volatile gles2::cmds::BlendEquationiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum mode = static_cast<GLenum>(c.mode);
error::Error error = DoBlendEquationiOES(buf, mode);
......@@ -4967,6 +4979,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleBlendEquationSeparateiOES(
const volatile gles2::cmds::BlendEquationSeparateiOES& c =
*static_cast<const volatile gles2::cmds::BlendEquationSeparateiOES*>(
cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum modeRGB = static_cast<GLenum>(c.modeRGB);
GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha);
......@@ -4982,6 +4998,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleBlendFunciOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::BlendFunciOES& c =
*static_cast<const volatile gles2::cmds::BlendFunciOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum src = static_cast<GLenum>(c.src);
GLenum dst = static_cast<GLenum>(c.dst);
......@@ -4998,6 +5018,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleBlendFuncSeparateiOES(
const volatile gles2::cmds::BlendFuncSeparateiOES& c =
*static_cast<const volatile gles2::cmds::BlendFuncSeparateiOES*>(
cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLenum srcRGB = static_cast<GLenum>(c.srcRGB);
GLenum dstRGB = static_cast<GLenum>(c.dstRGB);
......@@ -5016,6 +5040,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleColorMaskiOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::ColorMaskiOES& c =
*static_cast<const volatile gles2::cmds::ColorMaskiOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLuint buf = static_cast<GLuint>(c.buf);
GLboolean r = static_cast<GLboolean>(c.r);
GLboolean g = static_cast<GLboolean>(c.g);
......@@ -5033,6 +5061,10 @@ error::Error GLES2DecoderPassthroughImpl::HandleIsEnablediOES(
const volatile void* cmd_data) {
const volatile gles2::cmds::IsEnablediOES& c =
*static_cast<const volatile gles2::cmds::IsEnablediOES*>(cmd_data);
if (!features().oes_draw_buffers_indexed) {
return error::kUnknownCommand;
}
GLenum target = static_cast<GLenum>(c.target);
GLuint index = static_cast<GLuint>(c.index);
typedef cmds::IsEnablediOES::Result Result;
......
......@@ -12,66 +12,4 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_4_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_4_AUTOGEN_H_
TEST_P(GLES2DecoderTest4, BlendEquationiOESValidArgs) {
EXPECT_CALL(*gl_, BlendEquationiOES(1, GL_FUNC_SUBTRACT));
SpecializedSetup<cmds::BlendEquationiOES, 0>(true);
cmds::BlendEquationiOES cmd;
cmd.Init(1, GL_FUNC_SUBTRACT);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest4, BlendEquationSeparateiOESValidArgs) {
EXPECT_CALL(*gl_,
BlendEquationSeparateiOES(1, GL_FUNC_SUBTRACT, GL_FUNC_SUBTRACT));
SpecializedSetup<cmds::BlendEquationSeparateiOES, 0>(true);
cmds::BlendEquationSeparateiOES cmd;
cmd.Init(1, GL_FUNC_SUBTRACT, GL_FUNC_SUBTRACT);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest4, BlendFunciOESValidArgs) {
EXPECT_CALL(*gl_, BlendFunciOES(1, 2, 3));
SpecializedSetup<cmds::BlendFunciOES, 0>(true);
cmds::BlendFunciOES cmd;
cmd.Init(1, 2, 3);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest4, BlendFuncSeparateiOESValidArgs) {
EXPECT_CALL(*gl_, BlendFuncSeparateiOES(1, 2, 3, 4, 5));
SpecializedSetup<cmds::BlendFuncSeparateiOES, 0>(true);
cmds::BlendFuncSeparateiOES cmd;
cmd.Init(1, 2, 3, 4, 5);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest4, ColorMaskiOESValidArgs) {
EXPECT_CALL(*gl_, ColorMaskiOES(1, true, true, true, true));
SpecializedSetup<cmds::ColorMaskiOES, 0>(true);
cmds::ColorMaskiOES cmd;
cmd.Init(1, true, true, true, true);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest4, IsEnablediOESValidArgs) {
SpecializedSetup<cmds::IsEnablediOES, 0>(true);
cmds::IsEnablediOES cmd;
cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest4, IsEnablediOESInvalidArgsBadSharedMemoryId) {
SpecializedSetup<cmds::IsEnablediOES, 0>(false);
cmds::IsEnablediOES cmd;
cmd.Init(1, 2, kInvalidSharedMemoryId, shared_memory_offset_);
EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset);
EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
}
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_4_AUTOGEN_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment