Simplify the #ifdefs in GraphicsContext3D.h
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 May 2013 00:03:05 +0000 (00:03 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 May 2013 00:03:05 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=115568

Reviewed by Daniel Bates.

* platform/graphics/GraphicsContext3D.h:
(GraphicsContext3D): Combine #ifdefs paths that have a common
implementation. This reduces the #ifdef paths from many to just three.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::platformTexture): Move the implementation
here to simplify the header.
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::platformTexture): Ditto.
(WebCore):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149546 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext3D.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp

index 058930ced672c2b1d4bce8fda02abf90c2439707..46a927ac0c81f7489161033e5023acac0f4eece8 100644 (file)
@@ -1,3 +1,20 @@
+2013-05-03  Martin Robinson  <mrobinson@igalia.com>
+
+        Simplify the #ifdefs in GraphicsContext3D.h
+        https://bugs.webkit.org/show_bug.cgi?id=115568
+
+        Reviewed by Daniel Bates.
+
+        * platform/graphics/GraphicsContext3D.h:
+        (GraphicsContext3D): Combine #ifdefs paths that have a common
+        implementation. This reduces the #ifdef paths from many to just three.
+        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
+        (WebCore::GraphicsContext3D::platformTexture): Move the implementation
+        here to simplify the header.
+        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+        (WebCore::GraphicsContext3D::platformTexture): Ditto.
+        (WebCore):
+
 2013-05-03  Brendan Long  <b.long@cablelabs.com>
 
         [Qt] Build with --video-track fails because String(AtomicString) is ambiguous
index 05f1c7969a070d842898447b8926d24e1082268b..47f8cdf9212d0a7641568fe7edabd5539cd51aab 100644 (file)
@@ -1471,6 +1471,25 @@ unsigned GraphicsContext3D::getChannelBitsByFormat(GC3Denum format)
     }
 }
 
+#if !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(MAC)
+PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
+{
+    return NullPlatformGraphicsContext3D;
+}
+
+Platform3DObject GraphicsContext3D::platformTexture() const
+{
+    return NullPlatform3DObject;
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+PlatformLayer* GraphicsContext3D::platformLayer() const
+{
+    return 0;
+}
+#endif
+#endif
+
 } // namespace WebCore
 
 #endif // USE(3D_GRAPHICS)
index 005623bb8dc53b597ca60ae2215f3a2e2af9bcf9..871b723aad81c5ab1854d2043f416cc35319bb51 100644 (file)
@@ -488,37 +488,14 @@ public:
     PlatformGraphicsContext3D platformGraphicsContext3D() const { return m_contextObj; }
     Platform3DObject platformTexture() const { return m_compositorTexture; }
     CALayer* platformLayer() const { return reinterpret_cast<CALayer*>(m_webGLLayer.get()); }
-#elif PLATFORM(BLACKBERRY)
-    PlatformGraphicsContext3D platformGraphicsContext3D() const;
-    Platform3DObject platformTexture() const;
-#if USE(ACCELERATED_COMPOSITING)
-    PlatformLayer* platformLayer() const;
-#endif
-#elif PLATFORM(QT)
+#else
     PlatformGraphicsContext3D platformGraphicsContext3D();
     Platform3DObject platformTexture() const;
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) 
     PlatformLayer* platformLayer() const;
 #endif
-#elif PLATFORM(GTK)
-    PlatformGraphicsContext3D platformGraphicsContext3D();
-    Platform3DObject platformTexture() const { return m_texture; }
-#if USE(ACCELERATED_COMPOSITING)
-    PlatformLayer* platformLayer() const;
-#endif
-#elif PLATFORM(EFL)
-    PlatformGraphicsContext3D platformGraphicsContext3D();
-    Platform3DObject platformTexture() const { return m_texture; }
-#if USE(ACCELERATED_COMPOSITING)
-    PlatformLayer* platformLayer() const;
-#endif
-#else
-    PlatformGraphicsContext3D platformGraphicsContext3D() const { return NullPlatformGraphicsContext3D; }
-    Platform3DObject platformTexture() const { return NullPlatform3DObject; }
-#if USE(ACCELERATED_COMPOSITING)
-    PlatformLayer* platformLayer() const { return 0; }
-#endif
 #endif
+
     bool makeContextCurrent();
 
 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY)
index 21cbd1a95e74d2bf562bdf6060f300a828d367c2..a68b53b8c60f993bf7e0c5acd68bd39aee8965a2 100644 (file)
@@ -265,11 +265,17 @@ bool GraphicsContext3D::makeContextCurrent()
         return false;
     return m_private->makeContextCurrent();
 }
+
 PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
 {
     return m_private->platformContext();
 }
 
+Platform3DObject GraphicsContext3D::platformTexture() const
+{
+    return m_texture;
+}
+
 bool GraphicsContext3D::isGLES2Compliant() const
 {
 #if USE(OPENGL_ES_2)
index d712e4fbca509fab0c4e5050a8f9128a32b83848..12ca72664c3290fea274c963181b1ff1233f288f 100644 (file)
@@ -170,6 +170,11 @@ PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
     return m_private->platformGraphicsContext3D();
 }
 
+Platform3DObject GraphicsContext3D::platformTexture() const
+{
+    return m_texture;
+}
+
 #if USE(ACCELERATED_COMPOSITING)
 PlatformLayer* GraphicsContext3D::platformLayer() const
 {