Closed Bug 944830 Opened 11 years ago Closed 11 years ago

gfx/gl/GLBlitTextureImageHelper.cpp:115:13: error: unknown type name 'RectTriangles' in non-unified builds

Categories

(Core :: Graphics, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28
Tracking Status
firefox28 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 2 obsolete files)

gfx/gl/GLBlitTextureImageHelper.cpp:115:13: error: unknown type name 'RectTriangles'
            RectTriangles rects;
            ^
gfx/gl/GLBlitTextureImageHelper.cpp:136:17: error: use of undeclared identifier 'RectTriangles'
                RectTriangles::vert_coord* v = (RectTriangles::vert_coord*)rects.vertexPointer();
                ^
gfx/gl/GLBlitTextureImageHelper.cpp:136:49: error: use of undeclared identifier 'RectTriangles'
                RectTriangles::vert_coord* v = (RectTriangles::vert_coord*)rects.vertexPointer();
                                                ^
gfx/gl/GLBlitTextureImageHelper.cpp:136:75: error: expected expression
                RectTriangles::vert_coord* v = (RectTriangles::vert_coord*)rects.vertexPointer();
Blocks: 944172
I can get past this with:

diff --git a/gfx/gl/GLBlitTextureImageHelper.cpp b/gfx/gl/GLBlitTextureImageHelper.cpp
--- a/gfx/gl/GLBlitTextureImageHelper.cpp
+++ b/gfx/gl/GLBlitTextureImageHelper.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set ts=8 sts=4 et sw=4 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GLBlitTextureImageHelper.h"
+#include "DecomposeIntoNoRepeatTriangles.h"
 #include "GLContext.h"
 #include "nsRect.h"
 #include "gfx2DGlue.h"
 #include "gfxUtils.h"
 
 namespace mozilla {
 namespace gl {
 
And now I'm getting:

In file included from gfx/gl/GLContextUtils.cpp:7:
gfx/gl/GLContextUtils.h:23:70: error: unknown type name 'SurfaceFormat'; did you mean 'gfx::SurfaceFormat'?
ReadBackSurface(GLContext* aContext, GLuint aTexture, bool aYInvert, SurfaceFormat aFormat);
                                                                     ^~~~~~~~~~~~~
                                                                     gfx::SurfaceFormat
../../dist/include/mozilla/gfx/Types.h:34:6: note: 'gfx::SurfaceFormat' declared here
enum SurfaceFormat
     ^
gfx/gl/GLContextUtils.cpp:19:9: error: use of undeclared identifier 'Factory'
        Factory::CreateDataSourceSurface(gfx::ToIntSize(image->GetSize()), aFormat);
        ^
gfx/gl/GLContextUtils.cpp:19:47: error: no member named 'ToIntSize' in namespace 'mozilla::gfx'
        Factory::CreateDataSourceSurface(gfx::ToIntSize(image->GetSize()), aFormat);
                                         ~~~~~^
gfx/gl/GLContextUtils.cpp:21:24: error: no viable conversion from 'RefPtr<gfx::DataSourceSurface>' to
      'mozilla::gfx::SourceSurface *'
    if (!image->CopyTo(surf)) {
                       ^~~~
../../dist/include/mozilla/RefPtr.h:185:5: note: candidate template ignored: could not match 'TemporaryRef<type-parameter-0-0>'
      against 'mozilla::gfx::SourceSurface *'
    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }
    ^
../../dist/include/mozilla/RefPtr.h:181:5: note: candidate function
    operator T*() const { return ptr; }
    ^
../../dist/include/gfxImageSurface.h:109:47: note: passing argument to parameter 'aSurface' here
    bool CopyTo (mozilla::gfx::SourceSurface *aSurface);
                                              ^
In file included from gfx/gl/GLContextUtils.cpp:6:
In file included from gfx/gl/GLContext.h:42:
In file included from ../../dist/include/mozilla/GenericRefCounted.h:13:
../../dist/include/mozilla/RefPtr.h:197:10: error: member access into incomplete type 'mozilla::gfx::DataSourceSurface'
        t->AddRef();
         ^
../../dist/include/mozilla/RefPtr.h:222:41: note: in instantiation of member function
      'mozilla::RefPtr<mozilla::gfx::DataSourceSurface>::ref' requested here
    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}
                                        ^
gfx/gl/GLContextUtils.cpp:22:16: note: in instantiation of member function
      'mozilla::TemporaryRef<mozilla::gfx::DataSourceSurface>::TemporaryRef' requested here
        return nullptr;
               ^
gfx/gl/GLTextureImage.h:21:7: note: forward declaration of 'mozilla::gfx::DataSourceSurface'
class DataSourceSurface;
      ^
In file included from gfx/gl/GLContextUtils.cpp:6:
In file included from gfx/gl/GLContext.h:42:
In file included from ../../dist/include/mozilla/GenericRefCounted.h:13:
../../dist/include/mozilla/RefPtr.h:203:10: error: member access into incomplete type 'mozilla::gfx::DataSourceSurface'
        t->Release();
         ^
../../dist/include/mozilla/RefPtr.h:228:34: note: in instantiation of member function
      'mozilla::RefPtr<mozilla::gfx::DataSourceSurface>::unref' requested here
    ~TemporaryRef() { RefPtr<T>::unref(ptr); }
                                 ^
gfx/gl/GLContextUtils.cpp:22:16: note: in instantiation of member function
      'mozilla::TemporaryRef<mozilla::gfx::DataSourceSurface>::~TemporaryRef' requested here
        return nullptr;
               ^
gfx/gl/GLTextureImage.h:21:7: note: forward declaration of 'mozilla::gfx::DataSourceSurface'
class DataSourceSurface;
      ^
6 errors generated.
Blocks: 943293
And I can get past this with:

diff --git a/gfx/gl/GLContextUtils.cpp b/gfx/gl/GLContextUtils.cpp
--- a/gfx/gl/GLContextUtils.cpp
+++ b/gfx/gl/GLContextUtils.cpp
@@ -1,15 +1,17 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GLContext.h"
 #include "GLContextUtils.h"
+#include "mozilla/gfx/2D.h"
+#include "gfx2DGlue.h"
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace gl {
 
 TemporaryRef<gfx::DataSourceSurface>
 ReadBackSurface(GLContext* aContext, GLuint aTexture, bool aYInvert, SurfaceFormat aFormat)
diff --git a/gfx/gl/GLContextUtils.h b/gfx/gl/GLContextUtils.h
--- a/gfx/gl/GLContextUtils.h
+++ b/gfx/gl/GLContextUtils.h
@@ -15,14 +15,14 @@ namespace gfx {
   class DataSourceSurface;
 }
 }
 
 namespace mozilla {
 namespace gl {
 
 TemporaryRef<gfx::DataSourceSurface>
-ReadBackSurface(GLContext* aContext, GLuint aTexture, bool aYInvert, SurfaceFormat aFormat);
+ReadBackSurface(GLContext* aContext, GLuint aTexture, bool aYInvert, gfx::SurfaceFormat aFormat);
 
 } // namespace gl
 } // namespace mozilla
 
 #endif /* GLCONTEXTUTILS_H_ */

which now brings me to:
gfx/gl/GLScreenBuffer.cpp:342:9: error: unknown type name 'ScopedBindFramebuffer'
        ScopedBindFramebuffer boundFB(mGL);
        ^
gfx/gl/GLScreenBuffer.cpp:343:9: error: unknown type name 'ScopedGLState'
        ScopedGLState scissor(mGL, LOCAL_GL_SCISSOR_TEST, false);
        ^
gfx/gl/GLScreenBuffer.cpp:384:5: error: unknown type name 'ScopedBindFramebuffer'
    ScopedBindFramebuffer autoFB(mGL);
    ^
gfx/gl/GLScreenBuffer.cpp:498:5: error: unknown type name 'ScopedBindFramebuffer'
    ScopedBindFramebuffer autoFB(mGL, buffer->FB());
And:
diff --git a/gfx/gl/GLScreenBuffer.h b/gfx/gl/GLScreenBuffer.h
--- a/gfx/gl/GLScreenBuffer.h
+++ b/gfx/gl/GLScreenBuffer.h
@@ -14,16 +14,17 @@
 
 #ifndef SCREEN_BUFFER_H_
 #define SCREEN_BUFFER_H_
 
 #include "SurfaceTypes.h"
 #include "GLContextTypes.h"
 #include "GLDefs.h"
 #include "gfxPoint.h"
+#include "ScopedGLHelpers.h"
 
 // Forwards:
 class gfxImageSurface;
 
 namespace mozilla {
     namespace gfx {
         class SurfaceStream;
         class SharedSurface;

which gets me to:

gfx/gl/ScopedGLHelpers.h:19:5: error: unknown type name 'GLContext'
    GLContext* const mGL;
    ^
gfx/gl/ScopedGLHelpers.h:21:21: error: unknown type name 'GLContext'
    ScopedGLWrapper(GLContext* gl)

(...)
Blocks: 942492
I'll look into this asap (likely tomorrow). Can you indicate how to do a non-unified build?
Note the ScopedGLHelpers.cpp change is wrong, it should actually go in ScopedGLHelpers.h because the ScopedGLWrapper dereferences a GLContext pointer. But that causes other problems in other files because of missing types in GLContext.h, and I really didn't feel like chasing them all. I spent too much time on this already.
Attachment #8340571 - Flags: review?(bgirard)
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Comment on attachment 8340571 [details] [diff] [review]
Fix non-unified build in gfx after bug 942492, bug 943293 and bug 944172

Review of attachment 8340571 [details] [diff] [review]:
-----------------------------------------------------------------

R=me with the following change:

::: gfx/gl/GLScreenBuffer.h
@@ +18,5 @@
>  #include "SurfaceTypes.h"
>  #include "GLContextTypes.h"
>  #include "GLDefs.h"
>  #include "gfxPoint.h"
> +#include "ScopedGLHelpers.h"

That should not be needed in this reader, right? There is no usage of these Scoped* helpers in this header. Try to track down the cpp files actually using that? Maybe just GLScreenBuffer.cpp ?
Attachment #8340571 - Flags: review?(bgirard) → review+
Adjusted for ScopedGLHelpers.h.
Attachment #8340571 - Attachment is obsolete: true
Blocks: 907292
Attachment #8340589 - Attachment is obsolete: true
Comment on attachment 8340617 [details] [diff] [review]
Fix non-unified build in gfx after bug 942492, bug 943293 and bug 944172.

Review of attachment 8340617 [details] [diff] [review]:
-----------------------------------------------------------------

Many thanks!

Again I would be very interested in knowing how I can do non-unified builds myself so I can fix such errors in the future.
Attachment #8340617 - Flags: review?(bjacob) → review+
--disable-unified-compilation
https://hg.mozilla.org/mozilla-central/rev/24df3fc6014e
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: