Merge "Fix EGLConfigSelection for IVI on Genx." into tizen
authorRusty Lynch <rusty.lynch@intel.com>
Thu, 20 Jun 2013 01:15:31 +0000 (18:15 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 20 Jun 2013 01:15:31 +0000 (18:15 -0700)
Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DOffscreen.cpp
Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DOffscreen.h
Source/WebCore/platform/graphics/efl/tizen/SharedPlatformSurfaceTizen.cpp
Source/WebCore/platform/graphics/efl/tizen/SharedPlatformSurfaceTizen.h
Source/WebKit2/WebProcess/WebPage/efl/tizen/PlatformSurfacePoolTizen.cpp

index 80af7d0..118f01a 100755 (executable)
@@ -166,7 +166,17 @@ bool GraphicsContext3DOffscreen::initialize(HostWindow* hostWindow)
         return false;
 #if ENABLE(TIZEN_WEBKIT2)
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
-    RefPtr<PlatformSurfaceInfo> newSurface = adoptRef(new PlatformSurfaceInfo(IntSize(1, 1), m_attributes.alpha, m_attributes.depth, m_attributes.stencil));
+    GLPlatformSurface::SurfaceAttributes sharedSurfaceAttributes = GLPlatformSurface::Default;
+    if (m_attributes.alpha)
+        sharedSurfaceAttributes |= GLPlatformSurface::SupportAlpha;
+
+    if (m_attributes.depth)
+        sharedSurfaceAttributes |= GLPlatformSurface::SupportDepth;
+
+    if (m_attributes.stencil)
+        sharedSurfaceAttributes |= GLPlatformSurface::SupportStencil;
+
+    RefPtr<PlatformSurfaceInfo> newSurface = adoptRef(new PlatformSurfaceInfo(IntSize(1, 1), sharedSurfaceAttributes));
     if (!newSurface->m_platformSurface)
         return false;
 
@@ -462,7 +472,17 @@ SharedPlatformSurfaceTizen* GraphicsContext3DOffscreen::getFreePlatformSurface()
     }
     if (!newPlatformSurface) {
         if (m_platformSurfaces.size() < m_maxPlatformSurface) {
-            RefPtr<PlatformSurfaceInfo> newSurface = adoptRef(new PlatformSurfaceInfo(IntSize(m_width, m_height), m_attributes.alpha, m_attributes.depth, m_attributes.stencil));
+            GLPlatformSurface::SurfaceAttributes sharedSurfaceAttributes = GLPlatformSurface::Default;
+            if (m_attributes.alpha)
+                sharedSurfaceAttributes |= GLPlatformSurface::SupportAlpha;
+
+            if (m_attributes.depth)
+                sharedSurfaceAttributes |= GLPlatformSurface::SupportDepth;
+
+            if (m_attributes.stencil)
+                sharedSurfaceAttributes |= GLPlatformSurface::SupportStencil;
+
+            RefPtr<PlatformSurfaceInfo> newSurface = adoptRef(new PlatformSurfaceInfo(IntSize(m_width, m_height), sharedSurfaceAttributes));
             newPlatformSurface = newSurface->m_platformSurface.get();
 
             if (newPlatformSurface)
index 07565aa..857f81a 100755 (executable)
@@ -139,11 +139,11 @@ private:
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
     class PlatformSurfaceInfo : public RefCounted<PlatformSurfaceInfo> {
     public :
-        PlatformSurfaceInfo(const IntSize& size, bool hasAlpha, bool hasDepth, bool hasStencil)
+        PlatformSurfaceInfo(const IntSize& size, GLPlatformSurface::SurfaceAttributes attributes)
             : m_used(false)
             , m_size(size)
         {
-            m_platformSurface = SharedPlatformSurfaceTizen::create(size, false, hasAlpha, hasDepth, hasStencil);
+            m_platformSurface = SharedPlatformSurfaceTizen::create(size, attributes);
         };
 
         ~PlatformSurfaceInfo()
index e5fd601..ce826e4 100755 (executable)
@@ -105,10 +105,10 @@ GLPlatformContext* PixmapContextPool::getContext(GLPlatformSurface* surface)
     return pixmapContext;
 }
 
-PassOwnPtr<SharedPlatformSurfaceTizen> SharedPlatformSurfaceTizen::create(const IntSize& size, bool lockable, bool hasAlpha, bool hasDepth, bool hasStencil)
+PassOwnPtr<SharedPlatformSurfaceTizen> SharedPlatformSurfaceTizen::create(const IntSize& size, GLPlatformSurface::SurfaceAttributes attributes)
 {
-    OwnPtr<SharedPlatformSurfaceTizen> pixmap = adoptPtr(new SharedPlatformSurfaceTizen(size, lockable, hasAlpha, hasDepth, hasStencil));
-    if (!pixmap->initialize())
+    OwnPtr<SharedPlatformSurfaceTizen> pixmap = adoptPtr(new SharedPlatformSurfaceTizen(size));
+    if (!pixmap->initialize(attributes))
         return nullptr;
     return pixmap.release();
 }
@@ -131,25 +131,11 @@ bool SharedPlatformSurfaceTizen::supportsLockSurfaceExtension()
     return supportLockSurfaceExt;
 }
 
-SharedPlatformSurfaceTizen::SharedPlatformSurfaceTizen(const IntSize& size, bool lockable, bool hasAlpha, bool hasDepth, bool hasStencil)
+SharedPlatformSurfaceTizen::SharedPlatformSurfaceTizen(const IntSize& size)
     : m_size(size)
     , m_isUsed(false)
     , m_offScreenContext(0)
 {
-    m_sharedSurfaceAttributes = GLPlatformSurface::Default;
-
-    if (hasAlpha)
-        m_sharedSurfaceAttributes = GLPlatformSurface::SupportAlpha;
-
-    if (lockable)
-        m_sharedSurfaceAttributes = GLPlatformSurface::Lockable;
-    else {
-        if (hasDepth)
-            m_sharedSurfaceAttributes = GLPlatformSurface::SupportDepth;
-
-        if (hasStencil)
-            m_sharedSurfaceAttributes = GLPlatformSurface::SupportStencil;
-    }
 }
 
 SharedPlatformSurfaceTizen::~SharedPlatformSurfaceTizen()
@@ -160,15 +146,15 @@ SharedPlatformSurfaceTizen::~SharedPlatformSurfaceTizen()
     }
 }
 
-bool SharedPlatformSurfaceTizen::initialize()
+bool SharedPlatformSurfaceTizen::initialize(GLPlatformSurface::SurfaceAttributes attributes)
 {
     if (m_size.isEmpty())
         return false;
 
-    if ((m_sharedSurfaceAttributes & GLPlatformSurface::Lockable) && !supportsLockSurfaceExtension())
+    if ((attributes & GLPlatformSurface::Lockable) && !supportsLockSurfaceExtension())
         return false;
 
-    m_offScreenSurface = GLPlatformSurface::createOffScreenSurface(m_sharedSurfaceAttributes, m_size);
+    m_offScreenSurface = GLPlatformSurface::createOffScreenSurface(attributes, m_size);
 
     if (!m_offScreenSurface)
         return false;
index 5217cf2..9f2ec00 100755 (executable)
@@ -39,7 +39,7 @@ namespace WebCore {
 class GLPlatformContext;
 class SharedPlatformSurfaceTizen {
 public:
-    static PassOwnPtr<SharedPlatformSurfaceTizen> create(const IntSize&, bool lockable, bool hasAlpha = true, bool hasDepth = true, bool hasStencil = false);
+    static PassOwnPtr<SharedPlatformSurfaceTizen> create(const IntSize&, GLPlatformSurface::SurfaceAttributes);
     static bool supportsLockSurfaceExtension();
     virtual ~SharedPlatformSurfaceTizen();
     bool makeContextCurrent();
@@ -54,14 +54,13 @@ public:
     bool used() { return m_isUsed; }
     void setUsed(bool isUsed) { m_isUsed = isUsed; }
 private:
-    SharedPlatformSurfaceTizen(const IntSize&, bool lockable, bool hasAlpha, bool hasDepth, bool hasStencil);
+    SharedPlatformSurfaceTizen(const IntSize&);
 
-    bool initialize();
+    bool initialize(GLPlatformSurface::SurfaceAttributes);
     IntSize m_size;
     bool m_isUsed;
     OwnPtr<GLPlatformSurface> m_offScreenSurface;
     GLPlatformContext* m_offScreenContext;
-    GLPlatformSurface::SurfaceAttributes m_sharedSurfaceAttributes;
 };
 
 }
index c6ce2a4..001bf84 100644 (file)
@@ -55,7 +55,8 @@ PlatformSurfacePoolTizen::PlatformSurfaceInfo::PlatformSurfaceInfo(const IntSize
     , m_age(0)
     , m_tileID(0)
 {
-    m_SharedPlatformSurfaceTizen =  WebCore::SharedPlatformSurfaceTizen::create(size, true);
+    WebCore::GLPlatformSurface::SurfaceAttributes sharedSurfaceAttributes = WebCore::GLPlatformSurface::Lockable | WebCore::GLPlatformSurface::SupportAlpha;
+    m_SharedPlatformSurfaceTizen =  WebCore::SharedPlatformSurfaceTizen::create(size, sharedSurfaceAttributes);
 }
 
 PlatformSurfacePoolTizen::PlatformSurfacePoolTizen()