Title: [153843] trunk/Source/WebCore
Revision
153843
Author
[email protected]
Date
2013-08-08 13:19:27 -0700 (Thu, 08 Aug 2013)

Log Message

Work towards WebGL on AppleWin port.
https://bugs.webkit.org/show_bug.cgi?id=119562

Reviewed by Brent Fulgham.

* WebCore.vcxproj/WebCore.vcxproj:
Build GLContext.cpp and GraphicsContext3DPrivate.cpp on AppleWin port.
* WebCore.vcxproj/WebCore.vcxproj.filters:
Moved GLContext and GraphicsContext3DPrivate from Cairo filter to graphics.
* platform/graphics/GraphicsContext3D.h:
Added m_webGLLayer for AppleWin port.
* platform/graphics/GraphicsContext3DPrivate.cpp:
Protected inclusion of PlatformContextCairo.h in USE(CAIRO) macro for non-cairo ports.
* platform/graphics/win/GraphicsContext3DWin.cpp:
Removed stub GraphicsContext3DPrivate implementation in favor of GraphicsContext3DPrivate.cpp.
(WebCore::GraphicsContext3D::GraphicsContext3D):
Added GraphicsContext3DPrivate and PlatformCALayer initialization.
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
Added implementation based on Cairo ports' to be refactored soon.
(WebCore::GraphicsContext3D::platformLayer):
Return PlatformCALayer's PlatformLayer instead of 0.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153842 => 153843)


--- trunk/Source/WebCore/ChangeLog	2013-08-08 19:53:05 UTC (rev 153842)
+++ trunk/Source/WebCore/ChangeLog	2013-08-08 20:19:27 UTC (rev 153843)
@@ -1,3 +1,28 @@
+2013-08-08  Alex Christensen  <[email protected]>
+
+        Work towards WebGL on AppleWin port.
+        https://bugs.webkit.org/show_bug.cgi?id=119562
+
+        Reviewed by Brent Fulgham.
+
+        * WebCore.vcxproj/WebCore.vcxproj:
+        Build GLContext.cpp and GraphicsContext3DPrivate.cpp on AppleWin port.
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        Moved GLContext and GraphicsContext3DPrivate from Cairo filter to graphics.
+        * platform/graphics/GraphicsContext3D.h:
+        Added m_webGLLayer for AppleWin port.
+        * platform/graphics/GraphicsContext3DPrivate.cpp:
+        Protected inclusion of PlatformContextCairo.h in USE(CAIRO) macro for non-cairo ports.
+        * platform/graphics/win/GraphicsContext3DWin.cpp:
+        Removed stub GraphicsContext3DPrivate implementation in favor of GraphicsContext3DPrivate.cpp.
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        Added GraphicsContext3DPrivate and PlatformCALayer initialization.
+        (WebCore::GraphicsContext3D::makeContextCurrent):
+        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
+        Added implementation based on Cairo ports' to be refactored soon.
+        (WebCore::GraphicsContext3D::platformLayer):
+        Return PlatformCALayer's PlatformLayer instead of 0.
+
 2013-08-08  Jer Noble  <[email protected]>
 
         [EME] Implement MediaKeys.isTypeSupported()

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (153842 => 153843)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2013-08-08 19:53:05 UTC (rev 153842)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2013-08-08 20:19:27 UTC (rev 153843)
@@ -7340,14 +7340,7 @@
     <ClCompile Include="..\platform\graphics\avfoundation\cf\InbandTextTrackPrivateAVCF.cpp" />
     <ClCompile Include="..\platform\graphics\avfoundation\cf\InbandTextTrackPrivateLegacyAVCF.cpp" />
     <ClCompile Include="..\platform\graphics\avfoundation\InbandTextTrackPrivateAVF.cpp" />
-    <ClCompile Include="..\platform\graphics\GLContext.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
+    <ClCompile Include="..\platform\graphics\GLContext.cpp" />
     <ClCompile Include="..\platform\graphics\cairo\GraphicsContext3DCairo.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -7356,14 +7349,7 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\GraphicsContext3DPrivate.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
+    <ClCompile Include="..\platform\graphics\GraphicsContext3DPrivate.cpp" />
     <ClCompile Include="..\platform\graphics\ca\win\PlatformCAFiltersWin.cpp" />
     <ClCompile Include="..\platform\graphics\cg\GraphicsContext3DCG.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (153842 => 153843)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2013-08-08 19:53:05 UTC (rev 153842)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2013-08-08 20:19:27 UTC (rev 153843)
@@ -7030,15 +7030,9 @@
     <ClCompile Include="..\platform\graphics\cairo\GraphicsContext3DCairo.cpp">
       <Filter>platform\graphics\cairo</Filter>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\GraphicsContext3DPrivate.cpp">
-      <Filter>platform\graphics\cairo</Filter>
-    </ClCompile>
     <ClCompile Include="..\html\canvas\CanvasContextAttributes.cpp">
       <Filter>html\canvas</Filter>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\GLContext.cpp">
-      <Filter>platform\graphics\cairo</Filter>
-    </ClCompile>
     <ClCompile Include="..\platform\graphics\opengl\GraphicsContext3DOpenGLES.cpp">
       <Filter>platform\graphics\opengl</Filter>
     </ClCompile>
@@ -7058,6 +7052,12 @@
     <ClCompile Include="..\platform\graphics\win\GraphicsContext3DWin.cpp">
       <Filter>platform\graphics\win</Filter>
     </ClCompile>
+    <ClCompile Include="..\platform\graphics\GraphicsContext3DPrivate.cpp">
+      <Filter>platform\graphics</Filter>
+    </ClCompile>
+    <ClCompile Include="..\platform\graphics\GLContext.cpp">
+      <Filter>platform\graphics</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\filesystem\AsyncFileWriter.h">
@@ -14778,15 +14778,9 @@
     <ClInclude Include="..\page\CaptionUserPreferencesMediaAF.h">
       <Filter>page</Filter>
     </ClInclude>
-    <ClInclude Include="..\platform\graphics\GraphicsContext3DPrivate.h">
-      <Filter>platform\graphics\cairo</Filter>
-    </ClInclude>
     <ClInclude Include="..\html\canvas\CanvasContextAttributes.h">
       <Filter>html\canvas</Filter>
     </ClInclude>
-    <ClInclude Include="..\platform\graphics\GLContext.h">
-      <Filter>platform\graphics\cairo</Filter>
-    </ClInclude>
     <ClInclude Include="..\platform\graphics\egl\GLContextEGL.h">
       <Filter>platform\graphics\egl</Filter>
     </ClInclude>
@@ -14802,6 +14796,12 @@
     <ClInclude Include="..\platform\graphics\MediaPlayerPrivate.h">
       <Filter>platform\graphics</Filter>
     </ClInclude>
+    <ClInclude Include="..\platform\graphics\GraphicsContext3DPrivate.h">
+      <Filter>platform\graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\platform\graphics\GLContext.h">
+      <Filter>platform\graphics</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\css\CSSGrammar.y.in">

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (153842 => 153843)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h	2013-08-08 19:53:05 UTC (rev 153842)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h	2013-08-08 20:19:27 UTC (rev 153843)
@@ -38,6 +38,10 @@
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
+#if USE(CA)
+#include "PlatformCALayer.h"
+#endif
+
 // FIXME: Find a better way to avoid the name confliction for NO_ERROR.
 #if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS))
 #undef NO_ERROR
@@ -950,6 +954,8 @@
 #if PLATFORM(MAC)
     CGLContextObj m_contextObj;
     RetainPtr<WebGLLayer> m_webGLLayer;
+#elif PLATFORM(WIN) && USE(CA)
+    RefPtr<PlatformCALayer> m_webGLLayer;
 #elif PLATFORM(BLACKBERRY)
 #if USE(ACCELERATED_COMPOSITING)
     RefPtr<PlatformLayer> m_compositingLayer;

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp (153842 => 153843)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp	2013-08-08 19:53:05 UTC (rev 153842)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp	2013-08-08 20:19:27 UTC (rev 153843)
@@ -24,9 +24,12 @@
 
 #include "HostWindow.h"
 #include "NotImplemented.h"
-#include "PlatformContextCairo.h"
 #include <wtf/OwnArrayPtr.h>
 
+#if USE(CAIRO)
+#include "PlatformContextCairo.h"
+#endif
+
 #if USE(OPENGL_ES_2)
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>

Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp (153842 => 153843)


--- trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp	2013-08-08 19:53:05 UTC (rev 153842)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp	2013-08-08 20:19:27 UTC (rev 153843)
@@ -27,6 +27,7 @@
 
 #if USE(3D_GRAPHICS)
 
+#include "GraphicsContext3DPrivate.h"
 #include <wtf/NotFound.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
@@ -46,15 +47,6 @@
 
 namespace WebCore {
 
-// FIXME: This class is currently empty on Windows, but will get populated as 
-// the restructuring in https://bugs.webkit.org/show_bug.cgi?id=66903 is done
-class GraphicsContext3DPrivate {
-public:
-    GraphicsContext3DPrivate(GraphicsContext3D*) { }
-    
-    ~GraphicsContext3DPrivate() { }
-};
-
 PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
 {
     // This implementation doesn't currently support rendering directly to the HostWindow.
@@ -87,11 +79,16 @@
     , m_multisampleFBO(0)
     , m_multisampleDepthStencilBuffer(0)
     , m_multisampleColorBuffer(0)
+    , m_private(GraphicsContext3DPrivate::create(this, renderStyle))
 {
     makeContextCurrent();
 
     validateAttributes();
 
+#if USE(CA)
+    m_webGLLayer = PlatformCALayer::create(PlatformCALayer::LayerTypeLayer, 0);
+#endif
+
     if (renderStyle == RenderOffscreen) {
         // Create a texture to render into.
         ::glGenTextures(1, &m_texture);
@@ -176,12 +173,14 @@
 
 bool GraphicsContext3D::makeContextCurrent()
 {
-    return false;
+    if (!m_private)
+        return false;
+    return m_private->makeContextCurrent();
 }
 
 PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
 {
-    return 0;
+    return m_private->platformContext();
 }
 
 Platform3DObject GraphicsContext3D::platformTexture() const
@@ -201,7 +200,7 @@
 #if USE(ACCELERATED_COMPOSITING)
 PlatformLayer* GraphicsContext3D::platformLayer() const
 {
-    return 0;
+    return m_webGLLayer->platformLayer();
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to