diff options
author | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-04-30 13:17:32 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-04-30 19:02:17 +0000 |
commit | 3da7df93366b05bccbd319fd4232574722866b6c (patch) | |
tree | dccb53ae792229acccb0483020d326a006961751 | |
parent | 07bf8d7c73fba7bc7d9a6fd120f72cecad787088 (diff) |
Prevent conflicting declaration errors of GL typedefsv5.5.0-beta1
Including gpu/command_buffer headers in Qt code pollute by
including ui/gl/gl_bindings.h which pulls in system GL headers.
This will cause conflicting declaration of typedefs when included
together with content/gpu and content/common/gpu headers which
pull in gles2_cmd_format.h that forward declares some GL types.
Although the gl_bindings.h header states in a comment that
it should only be included in source files, the inline
implementation of texture_manager.h and some other low-level
GL integration headers nonetheless require gl_bindings.h,
which unfortunately cascades through to our core layer and
may cause problems when Qt code is compiled.
Since getting rid of this include in Chromium's headers is not
feasible due to maintenance costs, making sure that in Qt code
gpu/command_buffer headers are included before content/gpu and
content/common/gpu headers and guarding forward declarations
in gpu/command_buffer/common/gles2_cmd_format.h should be
a sufficient workaround. We can however get rid of the polluting
includes in src/core/gl_surface_qt.cpp, which only requires
forward declarations.
This also includes a SHA1 update for the Chromium submodule.
Task-number: QTBUG-44240
Change-Id: I5813a3663d36e2b565e4fd7f429add7b6f8f8a69
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/chromium_gpu_helper.cpp | 10 | ||||
-rw-r--r-- | src/core/gl_surface_qt.cpp | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 6d7b9ab74288eab0f846e5fa92854c9a49bee19 +Subproject 0decf91700ad48612b885a549e79bb6252196d4 diff --git a/src/core/chromium_gpu_helper.cpp b/src/core/chromium_gpu_helper.cpp index c7c97e60c..ef574eccd 100644 --- a/src/core/chromium_gpu_helper.cpp +++ b/src/core/chromium_gpu_helper.cpp @@ -40,13 +40,15 @@ #include "chromium_gpu_helper.h" -#include "content/common/gpu/gpu_channel_manager.h" -#include "content/common/gpu/sync_point_manager.h" -#include "content/gpu/gpu_child_thread.h" +// Including gpu/command_buffer headers before content/gpu headers makes sure that +// guards are defined to prevent duplicate definition errors with forward declared +// GL typedefs cascading through content header includes. #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/texture_manager.h" -#include <QtGlobal> // We need this for the Q_OS_QNX define. +#include "content/common/gpu/gpu_channel_manager.h" +#include "content/common/gpu/sync_point_manager.h" +#include "content/gpu/gpu_child_thread.h" #ifdef Q_OS_QNX #include "content/common/gpu/stream_texture_qnx.h" diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index 4fe2f2137..5a27aa98f 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -49,8 +49,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "content/common/gpu/image_transport_surface.h" -#include "content/common/gpu/gpu_channel_manager.h" -#include "content/common/gpu/gpu_command_buffer_stub.h" #include "ui/gl/egl_util.h" #include "ui/gl/gl_context.h" #include "ui/gl/gl_implementation.h" @@ -544,7 +542,9 @@ GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) } // namespace gfx namespace content { -scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(GpuChannelManager* manager, GpuCommandBufferStub* stub, const gfx::GLSurfaceHandle& handle) +class GpuCommandBufferStub; +class GpuChannelManager; +scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(GpuChannelManager*, GpuCommandBufferStub*, const gfx::GLSurfaceHandle&) { QT_NOT_USED return scoped_refptr<gfx::GLSurface>(); |