diff options
33 files changed, 252 insertions, 1 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt new file mode 100644 index 0000000..89574abd --- /dev/null +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_screen_space_antialiasing.txt @@ -0,0 +1,48 @@ +Name + + CHROMIUM_screen_space_antialiasing + +Name Strings + + GL_CHROMIUM_screen_space_antialiasing + +Version + + Last Modifed Date: August 27, 2015 + +Dependencies + + OpenGL ES 2.0 is required. + +Overview + + This extension performs the antialiasing to all color attachments of + the currently bound draw framebuffer. Reference GL_INTEL_framebuffer_CMAA + for more details. + +New Tokens + + None + +New Procedures and Functions + + void ApplyScreenSpaceAntialiasingCHROMIUM(void); + + Apply antialiasing to all color attachments of the currently bound draw framebuffer. + + INVALID_OPERATION is generated if any of the current draw buffers is multisampled. + + OUT_OF_MEMORY may be generated if fail to allocate internal resources necessary to + perform the requested operation. + +Errors + + None. + +New State + + None. + +Revision History + + 27/8/2015 Documented the extension diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h index 26a8650..810eff8 100644 --- a/gpu/GLES2/gl2chromium_autogen.h +++ b/gpu/GLES2/gl2chromium_autogen.h @@ -354,5 +354,7 @@ GLES2_GET_FUN(StencilThenCoverStrokePathCHROMIUM) #define glGetGraphicsResetStatusKHR GLES2_GET_FUN(GetGraphicsResetStatusKHR) #define glBlendBarrierKHR GLES2_GET_FUN(BlendBarrierKHR) +#define glApplyScreenSpaceAntialiasingCHROMIUM \ + GLES2_GET_FUN(ApplyScreenSpaceAntialiasingCHROMIUM) #endif // GPU_GLES2_GL2CHROMIUM_AUTOGEN_H_ diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index 157458c..f96c930 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h @@ -521,6 +521,15 @@ typedef GLboolean (GL_APIENTRYP PFNGLENABLEFEATURECHROMIUMPROC) ( #endif #endif /* GL_CHROMIUM_command_buffer_latency_query */ +/* GL_CHROMIUM_screen_space_antialiasing */ +#ifndef GL_CHROMIUM_screen_space_antialiasing +#define GL_CHROMIUM_screen_space_antialiasing 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glApplyScreenSpaceAntialiasingCHROMIUM(); +#endif +typedef void(GL_APIENTRYP PFNGLAPPLYSCREENSPACEANTIALIASINGCHROMIUMPROC)(); +#endif /* GL_CHROMIUM_screen_space_antialiasing */ + /* GL_ARB_robustness */ #ifndef GL_ARB_robustness #define GL_ARB_robustness 1 diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc index 2b39c53..576b7b7 100644 --- a/gpu/blink/webgraphicscontext3d_impl.cc +++ b/gpu/blink/webgraphicscontext3d_impl.cc @@ -258,6 +258,9 @@ DELEGATE_TO_GL_5(renderbufferStorageMultisampleCHROMIUM, DELEGATE_TO_GL_1(activeTexture, ActiveTexture, WGC3Denum) +DELEGATE_TO_GL(applyScreenSpaceAntialiasingCHROMIUM, + ApplyScreenSpaceAntialiasingCHROMIUM); + DELEGATE_TO_GL_2(attachShader, AttachShader, WebGLId, WebGLId) DELEGATE_TO_GL_3(bindAttribLocation, BindAttribLocation, WebGLId, diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h index 51c162a..88fa0e9 100644 --- a/gpu/blink/webgraphicscontext3d_impl.h +++ b/gpu/blink/webgraphicscontext3d_impl.h @@ -50,6 +50,7 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl virtual void postSubBufferCHROMIUM(int x, int y, int width, int height); virtual void activeTexture(blink::WGC3Denum texture); + virtual void applyScreenSpaceAntialiasingCHROMIUM(); virtual void attachShader(blink::WebGLId program, blink::WebGLId shader); virtual void bindAttribLocation(blink::WebGLId program, blink::WGC3Duint index, diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 902aca0..9b186d0 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -2134,6 +2134,12 @@ _FUNCTION_INFO = { 'impl_func': False, 'client_test': False, }, + 'ApplyScreenSpaceAntialiasingCHROMIUM': { + 'decoder_func': 'DoApplyScreenSpaceAntialiasingCHROMIUM', + 'extension_flag': 'chromium_screen_space_antialiasing', + 'unit_test': False, + 'client_test': False, + }, 'AttachShader': {'decoder_func': 'DoAttachShader'}, 'BindAttribLocation': { 'type': 'GLchar', diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 0e43ae7..870a4f9 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h @@ -1586,6 +1586,9 @@ GLenum GL_APIENTRY GLES2GetGraphicsResetStatusKHR() { void GL_APIENTRY GLES2BlendBarrierKHR() { gles2::GetGLContext()->BlendBarrierKHR(); } +void GL_APIENTRY GLES2ApplyScreenSpaceAntialiasingCHROMIUM() { + gles2::GetGLContext()->ApplyScreenSpaceAntialiasingCHROMIUM(); +} namespace gles2 { @@ -2815,6 +2818,11 @@ extern const NameToFunc g_gles2_function_table[] = { reinterpret_cast<GLES2FunctionPointer>(glBlendBarrierKHR), }, { + "glApplyScreenSpaceAntialiasingCHROMIUM", + reinterpret_cast<GLES2FunctionPointer>( + glApplyScreenSpaceAntialiasingCHROMIUM), + }, + { NULL, NULL, }, }; diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index d31d0d8..fb77fa2 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h @@ -2955,4 +2955,12 @@ void BlendBarrierKHR() { } } +void ApplyScreenSpaceAntialiasingCHROMIUM() { + gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM* c = + GetCmdSpace<gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM>(); + if (c) { + c->Init(); + } +} + #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index c0e5370..48d2e4f 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -1098,4 +1098,6 @@ GLenum GetGraphicsResetStatusKHR() override; void BlendBarrierKHR() override; +void ApplyScreenSpaceAntialiasingCHROMIUM() override; + #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h index 9f28fe2..9f8bfba 100644 --- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h @@ -3658,4 +3658,13 @@ void GLES2Implementation::BlendBarrierKHR() { CheckGLError(); } +void GLES2Implementation::ApplyScreenSpaceAntialiasingCHROMIUM() { + GPU_CLIENT_SINGLE_THREAD_CHECK(); + GPU_CLIENT_LOG("[" << GetLogPrefix() + << "] glApplyScreenSpaceAntialiasingCHROMIUM(" + << ")"); + helper_->ApplyScreenSpaceAntialiasingCHROMIUM(); + CheckGLError(); +} + #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index e152138..be4f4ee 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h @@ -812,4 +812,5 @@ virtual void StencilThenCoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) = 0; virtual GLenum GetGraphicsResetStatusKHR() = 0; virtual void BlendBarrierKHR() = 0; +virtual void ApplyScreenSpaceAntialiasingCHROMIUM() = 0; #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 2bb37f3..321ce34 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h @@ -786,4 +786,5 @@ void StencilThenCoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override; GLenum GetGraphicsResetStatusKHR() override; void BlendBarrierKHR() override; +void ApplyScreenSpaceAntialiasingCHROMIUM() override; #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index b4a3e58..1318f09 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h @@ -1079,4 +1079,5 @@ GLenum GLES2InterfaceStub::GetGraphicsResetStatusKHR() { return 0; } void GLES2InterfaceStub::BlendBarrierKHR() {} +void GLES2InterfaceStub::ApplyScreenSpaceAntialiasingCHROMIUM() {} #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_IMPL_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index 1d0842f..241623d 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h @@ -786,4 +786,5 @@ void StencilThenCoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override; GLenum GetGraphicsResetStatusKHR() override; void BlendBarrierKHR() override; +void ApplyScreenSpaceAntialiasingCHROMIUM() override; #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index cfee942..d527fd1 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h @@ -2321,4 +2321,10 @@ void GLES2TraceImplementation::BlendBarrierKHR() { gl_->BlendBarrierKHR(); } +void GLES2TraceImplementation::ApplyScreenSpaceAntialiasingCHROMIUM() { + TRACE_EVENT_BINARY_EFFICIENT0( + "gpu", "GLES2Trace::ApplyScreenSpaceAntialiasingCHROMIUM"); + gl_->ApplyScreenSpaceAntialiasingCHROMIUM(); +} + #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_IMPL_AUTOGEN_H_ diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index d9f8515..f355571 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt @@ -336,3 +336,6 @@ GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void); // Extension KHR_blend_equation_advanced GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void); + +// Extension GL_CHROMIUM_screen_space_antialiasing +GL_APICALL void GL_APIENTRY glApplyScreenSpaceAntialiasingCHROMIUM (void); diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 69a0d5e..3f288cb 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -14381,4 +14381,32 @@ static_assert(sizeof(BlendBarrierKHR) == 4, static_assert(offsetof(BlendBarrierKHR, header) == 0, "offset of BlendBarrierKHR header should be 0"); +struct ApplyScreenSpaceAntialiasingCHROMIUM { + typedef ApplyScreenSpaceAntialiasingCHROMIUM ValueType; + static const CommandId kCmdId = kApplyScreenSpaceAntialiasingCHROMIUM; + static const cmd::ArgFlags kArgFlags = cmd::kFixed; + static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); + + static uint32_t ComputeSize() { + return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT + } + + void SetHeader() { header.SetCmd<ValueType>(); } + + void Init() { SetHeader(); } + + void* Set(void* cmd) { + static_cast<ValueType*>(cmd)->Init(); + return NextCmdAddress<ValueType>(cmd); + } + + gpu::CommandHeader header; +}; + +static_assert(sizeof(ApplyScreenSpaceAntialiasingCHROMIUM) == 4, + "size of ApplyScreenSpaceAntialiasingCHROMIUM should be 4"); +static_assert( + offsetof(ApplyScreenSpaceAntialiasingCHROMIUM, header) == 0, + "offset of ApplyScreenSpaceAntialiasingCHROMIUM header should be 0"); + #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index bd4d764..1856e65 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -5086,4 +5086,15 @@ TEST_F(GLES2FormatTest, BlendBarrierKHR) { CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } +TEST_F(GLES2FormatTest, ApplyScreenSpaceAntialiasingCHROMIUM) { + cmds::ApplyScreenSpaceAntialiasingCHROMIUM& cmd = + *GetBufferAs<cmds::ApplyScreenSpaceAntialiasingCHROMIUM>(); + void* next_cmd = cmd.Set(&cmd); + EXPECT_EQ( + static_cast<uint32_t>(cmds::ApplyScreenSpaceAntialiasingCHROMIUM::kCmdId), + cmd.header.command); + EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); + CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); +} + #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h index 010dac0..8951440 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h @@ -316,7 +316,8 @@ OP(CoverStrokePathCHROMIUM) /* 557 */ \ OP(StencilThenCoverFillPathCHROMIUM) /* 558 */ \ OP(StencilThenCoverStrokePathCHROMIUM) /* 559 */ \ - OP(BlendBarrierKHR) /* 560 */ + OP(BlendBarrierKHR) /* 560 */ \ + OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 561 */ enum CommandId { kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this. diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index b3c5be6..1505e8c 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -130,6 +130,7 @@ FeatureInfo::FeatureFlags::FeatureFlags() use_core_framebuffer_multisample(false), multisampled_render_to_texture(false), use_img_for_multisampled_render_to_texture(false), + chromium_screen_space_antialiasing(false), oes_standard_derivatives(false), oes_egl_image_external(false), oes_depth24(false), @@ -733,6 +734,11 @@ void FeatureInfo::InitializeFeatures() { } } + if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) { + feature_flags_.chromium_screen_space_antialiasing = true; + AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); + } + if (extensions.Contains("GL_OES_depth24") || gfx::HasDesktopGLFeatures() || gl_version_info_->is_es3) { AddExtensionString("GL_OES_depth24"); diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h index dae148a..9bd0f93 100644 --- a/gpu/command_buffer/service/feature_info.h +++ b/gpu/command_buffer/service/feature_info.h @@ -42,6 +42,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { bool multisampled_render_to_texture; // Use the IMG GLenum values and functions rather than EXT. bool use_img_for_multisampled_render_to_texture; + bool chromium_screen_space_antialiasing; bool oes_standard_derivatives; bool oes_egl_image_external; bool oes_depth24; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index c9edcdd4..0a4079f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1060,6 +1060,7 @@ class GLES2DecoderImpl : public GLES2Decoder, void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key); void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key, GLuint client_id); + void DoApplyScreenSpaceAntialiasingCHROMIUM(); bool DoIsValuebufferCHROMIUM(GLuint client_id); void DoBindValueBufferCHROMIUM(GLenum target, GLuint valuebuffer); @@ -13847,6 +13848,13 @@ void GLES2DecoderImpl::DoCreateAndConsumeTextureCHROMIUM(GLenum target, texture_ref = texture_manager()->Consume(client_id, texture); } +void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { + // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the + // color attachments of currently bound draw framebuffer. + // Reference GL_INTEL_framebuffer_CMAA for details. + glApplyFramebufferAttachmentCMAAINTEL(); +} + bool GLES2DecoderImpl::DoIsValuebufferCHROMIUM(GLuint client_id) { const Valuebuffer* valuebuffer = GetValuebuffer(client_id); return valuebuffer && valuebuffer->IsValid(); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index b8bb7c1..62b6dbc 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -5066,6 +5066,24 @@ error::Error GLES2DecoderImpl::HandleBlendBarrierKHR( return error::kNoError; } +error::Error GLES2DecoderImpl::HandleApplyScreenSpaceAntialiasingCHROMIUM( + uint32_t immediate_data_size, + const void* cmd_data) { + const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM& c = + *static_cast<const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM*>( + cmd_data); + (void)c; + if (!features().chromium_screen_space_antialiasing) { + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, + "glApplyScreenSpaceAntialiasingCHROMIUM", + "function not available"); + return error::kNoError; + } + + DoApplyScreenSpaceAntialiasingCHROMIUM(); + return error::kNoError; +} + bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) { switch (cap) { case GL_BLEND: diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h index 5c22b6c..b990467 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions_autogen.h @@ -102,4 +102,5 @@ TEST_P(GLES2DecoderTestWithBlendEquationAdvanced, BlendBarrierKHRValidArgs) { EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } +// TODO(gman): ApplyScreenSpaceAntialiasingCHROMIUM #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_EXTENSIONS_AUTOGEN_H_ diff --git a/mojo/gpu/mojo_gles2_impl_autogen.cc b/mojo/gpu/mojo_gles2_impl_autogen.cc index 55e8ba6..d706d62 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.cc +++ b/mojo/gpu/mojo_gles2_impl_autogen.cc @@ -1721,5 +1721,8 @@ GLenum MojoGLES2Impl::GetGraphicsResetStatusKHR() { void MojoGLES2Impl::BlendBarrierKHR() { NOTREACHED() << "Unimplemented BlendBarrierKHR."; } +void MojoGLES2Impl::ApplyScreenSpaceAntialiasingCHROMIUM() { + NOTREACHED() << "Unimplemented ApplyScreenSpaceAntialiasingCHROMIUM."; +} } // namespace mojo diff --git a/mojo/gpu/mojo_gles2_impl_autogen.h b/mojo/gpu/mojo_gles2_impl_autogen.h index 0d1047b..f5f8b75 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.h +++ b/mojo/gpu/mojo_gles2_impl_autogen.h @@ -815,6 +815,7 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface { GLenum coverMode) override; GLenum GetGraphicsResetStatusKHR() override; void BlendBarrierKHR() override; + void ApplyScreenSpaceAntialiasingCHROMIUM() override; private: MojoGLES2Context context_; diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py index a3c4824..3cb87b0 100755 --- a/ui/gl/generate_bindings.py +++ b/ui/gl/generate_bindings.py @@ -49,6 +49,11 @@ GL_FUNCTIONS = [ 'names': ['glActiveTexture'], 'arguments': 'GLenum texture', }, { 'return_type': 'void', + 'known_as': 'glApplyFramebufferAttachmentCMAAINTEL', + 'versions': [{ 'name': 'glApplyFramebufferAttachmentCMAAINTEL', + 'extensions': ['GL_INTEL_framebuffer_CMAA'] }], + 'arguments': 'void', }, +{ 'return_type': 'void', 'names': ['glAttachShader'], 'arguments': 'GLuint program, GLuint shader', }, { 'return_type': 'void', diff --git a/ui/gl/gl_bindings_api_autogen_gl.h b/ui/gl/gl_bindings_api_autogen_gl.h index d75fdad..aabf919 100644 --- a/ui/gl/gl_bindings_api_autogen_gl.h +++ b/ui/gl/gl_bindings_api_autogen_gl.h @@ -9,6 +9,7 @@ // DO NOT EDIT! void glActiveTextureFn(GLenum texture) override; +void glApplyFramebufferAttachmentCMAAINTELFn(void) override; void glAttachShaderFn(GLuint program, GLuint shader) override; void glBeginQueryFn(GLenum target, GLuint id) override; void glBeginTransformFeedbackFn(GLenum primitiveMode) override; diff --git a/ui/gl/gl_bindings_autogen_gl.cc b/ui/gl/gl_bindings_autogen_gl.cc index c2493db..2917d99 100644 --- a/ui/gl/gl_bindings_autogen_gl.cc +++ b/ui/gl/gl_bindings_autogen_gl.cc @@ -26,6 +26,7 @@ DriverGL g_driver_gl; void DriverGL::InitializeStaticBindings() { fn.glActiveTextureFn = reinterpret_cast<glActiveTextureProc>( GetGLProcAddress("glActiveTexture")); + fn.glApplyFramebufferAttachmentCMAAINTELFn = 0; fn.glAttachShaderFn = reinterpret_cast<glAttachShaderProc>(GetGLProcAddress("glAttachShader")); fn.glBeginQueryFn = 0; @@ -528,6 +529,8 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { ext.b_GL_IMG_multisampled_render_to_texture = extensions.find("GL_IMG_multisampled_render_to_texture ") != std::string::npos; + ext.b_GL_INTEL_framebuffer_CMAA = + extensions.find("GL_INTEL_framebuffer_CMAA ") != std::string::npos; ext.b_GL_KHR_blend_equation_advanced = extensions.find("GL_KHR_blend_equation_advanced ") != std::string::npos; ext.b_GL_KHR_robustness = @@ -546,6 +549,14 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { ext.b_GL_OES_vertex_array_object = extensions.find("GL_OES_vertex_array_object ") != std::string::npos; + debug_fn.glApplyFramebufferAttachmentCMAAINTELFn = 0; + if (ext.b_GL_INTEL_framebuffer_CMAA) { + fn.glApplyFramebufferAttachmentCMAAINTELFn = + reinterpret_cast<glApplyFramebufferAttachmentCMAAINTELProc>( + GetGLProcAddress("glApplyFramebufferAttachmentCMAAINTEL")); + DCHECK(fn.glApplyFramebufferAttachmentCMAAINTELFn); + } + debug_fn.glBeginQueryFn = 0; if (!ver->is_es || ver->IsAtLeastGLES(3u, 0u)) { fn.glBeginQueryFn = @@ -2120,6 +2131,13 @@ static void GL_BINDING_CALL Debug_glActiveTexture(GLenum texture) { g_driver_gl.debug_fn.glActiveTextureFn(texture); } +static void GL_BINDING_CALL Debug_glApplyFramebufferAttachmentCMAAINTEL(void) { + GL_SERVICE_LOG("glApplyFramebufferAttachmentCMAAINTEL" + << "(" + << ")"); + g_driver_gl.debug_fn.glApplyFramebufferAttachmentCMAAINTELFn(); +} + static void GL_BINDING_CALL Debug_glAttachShader(GLuint program, GLuint shader) { GL_SERVICE_LOG("glAttachShader" @@ -5022,6 +5040,12 @@ void DriverGL::InitializeDebugBindings() { debug_fn.glActiveTextureFn = fn.glActiveTextureFn; fn.glActiveTextureFn = Debug_glActiveTexture; } + if (!debug_fn.glApplyFramebufferAttachmentCMAAINTELFn) { + debug_fn.glApplyFramebufferAttachmentCMAAINTELFn = + fn.glApplyFramebufferAttachmentCMAAINTELFn; + fn.glApplyFramebufferAttachmentCMAAINTELFn = + Debug_glApplyFramebufferAttachmentCMAAINTEL; + } if (!debug_fn.glAttachShaderFn) { debug_fn.glAttachShaderFn = fn.glAttachShaderFn; fn.glAttachShaderFn = Debug_glAttachShader; @@ -6252,6 +6276,10 @@ void GLApiBase::glActiveTextureFn(GLenum texture) { driver_->fn.glActiveTextureFn(texture); } +void GLApiBase::glApplyFramebufferAttachmentCMAAINTELFn(void) { + driver_->fn.glApplyFramebufferAttachmentCMAAINTELFn(); +} + void GLApiBase::glAttachShaderFn(GLuint program, GLuint shader) { driver_->fn.glAttachShaderFn(program, shader); } @@ -7989,6 +8017,12 @@ void TraceGLApi::glActiveTextureFn(GLenum texture) { gl_api_->glActiveTextureFn(texture); } +void TraceGLApi::glApplyFramebufferAttachmentCMAAINTELFn(void) { + TRACE_EVENT_BINARY_EFFICIENT0( + "gpu", "TraceGLAPI::glApplyFramebufferAttachmentCMAAINTEL") + gl_api_->glApplyFramebufferAttachmentCMAAINTELFn(); +} + void TraceGLApi::glAttachShaderFn(GLuint program, GLuint shader) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glAttachShader") gl_api_->glAttachShaderFn(program, shader); @@ -10049,6 +10083,13 @@ void NoContextGLApi::glActiveTextureFn(GLenum texture) { LOG(ERROR) << "Trying to call glActiveTexture() without current GL context"; } +void NoContextGLApi::glApplyFramebufferAttachmentCMAAINTELFn(void) { + NOTREACHED() << "Trying to call glApplyFramebufferAttachmentCMAAINTEL() " + "without current GL context"; + LOG(ERROR) << "Trying to call glApplyFramebufferAttachmentCMAAINTEL() " + "without current GL context"; +} + void NoContextGLApi::glAttachShaderFn(GLuint program, GLuint shader) { NOTREACHED() << "Trying to call glAttachShader() without current GL context"; LOG(ERROR) << "Trying to call glAttachShader() without current GL context"; diff --git a/ui/gl/gl_bindings_autogen_gl.h b/ui/gl/gl_bindings_autogen_gl.h index 3a16380..15a9518 100644 --- a/ui/gl/gl_bindings_autogen_gl.h +++ b/ui/gl/gl_bindings_autogen_gl.h @@ -16,6 +16,7 @@ namespace gfx { class GLContext; typedef void(GL_BINDING_CALL* glActiveTextureProc)(GLenum texture); +typedef void(GL_BINDING_CALL* glApplyFramebufferAttachmentCMAAINTELProc)(void); typedef void(GL_BINDING_CALL* glAttachShaderProc)(GLuint program, GLuint shader); typedef void(GL_BINDING_CALL* glBeginQueryProc)(GLenum target, GLuint id); @@ -977,6 +978,7 @@ struct ExtensionsGL { bool b_GL_EXT_texture_storage; bool b_GL_EXT_timer_query; bool b_GL_IMG_multisampled_render_to_texture; + bool b_GL_INTEL_framebuffer_CMAA; bool b_GL_KHR_blend_equation_advanced; bool b_GL_KHR_robustness; bool b_GL_NV_blend_equation_advanced; @@ -990,6 +992,8 @@ struct ExtensionsGL { struct ProcsGL { glActiveTextureProc glActiveTextureFn; + glApplyFramebufferAttachmentCMAAINTELProc + glApplyFramebufferAttachmentCMAAINTELFn; glAttachShaderProc glAttachShaderFn; glBeginQueryProc glBeginQueryFn; glBeginTransformFeedbackProc glBeginTransformFeedbackFn; @@ -1302,6 +1306,7 @@ class GL_EXPORT GLApi { virtual ~GLApi(); virtual void glActiveTextureFn(GLenum texture) = 0; + virtual void glApplyFramebufferAttachmentCMAAINTELFn(void) = 0; virtual void glAttachShaderFn(GLuint program, GLuint shader) = 0; virtual void glBeginQueryFn(GLenum target, GLuint id) = 0; virtual void glBeginTransformFeedbackFn(GLenum primitiveMode) = 0; @@ -2119,6 +2124,8 @@ class GL_EXPORT GLApi { } // namespace gfx #define glActiveTexture ::gfx::g_current_gl_context->glActiveTextureFn +#define glApplyFramebufferAttachmentCMAAINTEL \ + ::gfx::g_current_gl_context->glApplyFramebufferAttachmentCMAAINTELFn #define glAttachShader ::gfx::g_current_gl_context->glAttachShaderFn #define glBeginQuery ::gfx::g_current_gl_context->glBeginQueryFn #define glBeginTransformFeedback \ diff --git a/ui/gl/gl_bindings_autogen_mock.cc b/ui/gl/gl_bindings_autogen_mock.cc index 07b01f5..41a38df 100644 --- a/ui/gl/gl_bindings_autogen_mock.cc +++ b/ui/gl/gl_bindings_autogen_mock.cc @@ -26,6 +26,12 @@ void GL_BINDING_CALL MockGLInterface::Mock_glActiveTexture(GLenum texture) { interface_->ActiveTexture(texture); } +void GL_BINDING_CALL +MockGLInterface::Mock_glApplyFramebufferAttachmentCMAAINTEL(void) { + MakeFunctionUnique("glApplyFramebufferAttachmentCMAAINTEL"); + interface_->ApplyFramebufferAttachmentCMAAINTEL(); +} + void GL_BINDING_CALL MockGLInterface::Mock_glAttachShader(GLuint program, GLuint shader) { MakeFunctionUnique("glAttachShader"); @@ -2691,6 +2697,8 @@ static void MockInvalidFunction() { void* GL_BINDING_CALL MockGLInterface::GetGLProcAddress(const char* name) { if (strcmp(name, "glActiveTexture") == 0) return reinterpret_cast<void*>(Mock_glActiveTexture); + if (strcmp(name, "glApplyFramebufferAttachmentCMAAINTEL") == 0) + return reinterpret_cast<void*>(Mock_glApplyFramebufferAttachmentCMAAINTEL); if (strcmp(name, "glAttachShader") == 0) return reinterpret_cast<void*>(Mock_glAttachShader); if (strcmp(name, "glBeginQuery") == 0) diff --git a/ui/gl/gl_bindings_autogen_mock.h b/ui/gl/gl_bindings_autogen_mock.h index 37049b87..c0f0091 100644 --- a/ui/gl/gl_bindings_autogen_mock.h +++ b/ui/gl/gl_bindings_autogen_mock.h @@ -9,6 +9,7 @@ // DO NOT EDIT! static void GL_BINDING_CALL Mock_glActiveTexture(GLenum texture); +static void GL_BINDING_CALL Mock_glApplyFramebufferAttachmentCMAAINTEL(void); static void GL_BINDING_CALL Mock_glAttachShader(GLuint program, GLuint shader); static void GL_BINDING_CALL Mock_glBeginQuery(GLenum target, GLuint id); static void GL_BINDING_CALL Mock_glBeginQueryARB(GLenum target, GLuint id); diff --git a/ui/gl/gl_mock_autogen_gl.h b/ui/gl/gl_mock_autogen_gl.h index bd08515..53c49df 100644 --- a/ui/gl/gl_mock_autogen_gl.h +++ b/ui/gl/gl_mock_autogen_gl.h @@ -9,6 +9,7 @@ // DO NOT EDIT! MOCK_METHOD1(ActiveTexture, void(GLenum texture)); +MOCK_METHOD0(ApplyFramebufferAttachmentCMAAINTEL, void()); MOCK_METHOD2(AttachShader, void(GLuint program, GLuint shader)); MOCK_METHOD2(BeginQuery, void(GLenum target, GLuint id)); MOCK_METHOD1(BeginTransformFeedback, void(GLenum primitiveMode)); |