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;
}
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)
#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()
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();
}
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()
}
}
-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;
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();
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;
};
}
, 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()