Bug 95965

Summary: [Qt] Fix build with ANGLE on platforms that provide EGL/GLESv2
Product: WebKit Reporter: Simon Hausmann <hausmann>
Component: New BugsAssignee: Simon Hausmann <hausmann>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, cmarcelo, menard, milian.wolff, ossy, vestbo, webkit.review.bot, zarvai, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch vestbo: review+

Description Simon Hausmann 2012-09-06 03:11:42 PDT
[Qt] Fix build with ANGLE on platforms that provide EGL/GLESv2
Comment 1 Simon Hausmann 2012-09-06 03:19:29 PDT
For the Qt port we need only the shader compiler from ANGLE, for validation of shader rewriting. We do not need the EGL/GLESv2 API it provides on any platform.

The shader "API" we need is declared in include/GLSLANG/ShaderLang.h and the EGL/GLESV2 API is declared in include/EGL and include/GLES2.

For building ANGLE itself we need to have the EGL/GLES2 directories in the include path. For the use of ANGLE in WebCore we need include/GLSLANG in the include search path.

The problem at hand is that we build ANGLE as part of WebCore and therefore need two sets of include paths at the same time. That means when building WebCore we do have directories in the include search path that declare EGL and GLESv2 APIs. At the same time there is code in WebCore that _uses_ EGL and GLESv2 (GraphicsContext3D for example), and we do want _that_ code to use the _system_ EGL/GLESv2 implementation. The presence of those ANGLE include paths result in a conflict and cause build issues in environments where EGL and GLESv2 are part of the platform.

The solution is to build ANGLE as a separate static library, with its own EGL/GLES2 include search paths present. There is no risk of conflict with system components as we do not end up using that code at run-time anyway.

Then in WebCore we can just add the include/GLSLANG path into the include search path and be sure that any usage of EGL and GLESv2 will hit the system header files.

As an extra bonus the build of ANGLE as a separate static library simplifies the current approach of having different compile flags for some of the ANGLE sources.
Comment 2 Simon Hausmann 2012-09-06 03:24:24 PDT
Created attachment 162465 [details]
Patch
Comment 3 Tor Arne Vestbø 2012-09-06 03:28:15 PDT
Comment on attachment 162465 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=162465&action=review

awesome!

> Source/WebCore/Target.pri:3930
> +    WEBKIT += ANGLE

nitpick, but WEBKIT += angle

We take care of the casing in default_post

> Source/WebKit/WebKit1.pro:155
> +contains(DEFINES, WTF_USE_3D_GRAPHICS=1): WEBKIT += ANGLE

Ditto

> Source/api.pri:88
> +contains(DEFINES, WTF_USE_3D_GRAPHICS=1): WEBKIT += ANGLE

Ditto
Comment 4 Simon Hausmann 2012-09-06 03:55:33 PDT
Committed r127724: <http://trac.webkit.org/changeset/127724>
Comment 5 Simon Hausmann 2012-09-06 22:46:04 PDT
*** Bug 95560 has been marked as a duplicate of this bug. ***