[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
jpetsovits at rim.com
jpetsovits at rim.com
Wed Mar 17 18:36:55 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 72cf99fa22cf740d63261f09d05f6001a50b8dbd
Author: jpetsovits at rim.com <jpetsovits at rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Mar 12 19:11:28 2010 +0000
2010-03-12 Jakob Petsovits <jpetsovits at rim.com>
Reviewed by Dirk Schulze.
[OpenVG] Add a SurfaceOpenVG constructor for EGL client buffer surfaces
https://bugs.webkit.org/show_bug.cgi?id=35538
SurfaceOpenVG can now not only encapsulate pbuffer
and window surfaces but also VGImage-based ones.
* platform/graphics/openvg/EGLDisplayOpenVG.cpp:
(WebCore::EGLDisplayOpenVG::createPbufferFromClientBuffer):
* platform/graphics/openvg/EGLDisplayOpenVG.h:
* platform/graphics/openvg/SurfaceOpenVG.cpp:
(WebCore::SurfaceOpenVG::SurfaceOpenVG):
* platform/graphics/openvg/SurfaceOpenVG.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bbaa093..9550a3d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-12 Jakob Petsovits <jpetsovits at rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ [OpenVG] Add a SurfaceOpenVG constructor for EGL client buffer surfaces
+ https://bugs.webkit.org/show_bug.cgi?id=35538
+
+ SurfaceOpenVG can now not only encapsulate pbuffer
+ and window surfaces but also VGImage-based ones.
+
+ * platform/graphics/openvg/EGLDisplayOpenVG.cpp:
+ (WebCore::EGLDisplayOpenVG::createPbufferFromClientBuffer):
+ * platform/graphics/openvg/EGLDisplayOpenVG.h:
+ * platform/graphics/openvg/SurfaceOpenVG.cpp:
+ (WebCore::SurfaceOpenVG::SurfaceOpenVG):
+ * platform/graphics/openvg/SurfaceOpenVG.h:
+
2010-03-12 Alpha Lam <hclam at chromium.org>
Reviewed by Eric Carlson.
diff --git a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp
index 3c7eaf2..d681d75 100644
--- a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp
@@ -263,6 +263,30 @@ EGLSurface EGLDisplayOpenVG::createPbufferSurface(const IntSize& size, const EGL
return surface;
}
+EGLSurface EGLDisplayOpenVG::createPbufferFromClientBuffer(
+ EGLClientBuffer clientBuffer, EGLenum bufferType, const EGLConfig& config, EGLint* errorCode)
+{
+ EGLSurface surface = eglCreatePbufferFromClientBuffer(m_display,
+ bufferType, clientBuffer, config, 0 /* attribList */);
+
+ if (errorCode)
+ *errorCode = eglGetError();
+ else
+ ASSERT_EGL_NO_ERROR();
+
+ if (surface == EGL_NO_SURFACE)
+ return EGL_NO_SURFACE;
+
+ EGLint surfaceConfigId;
+ EGLBoolean success = eglGetConfigAttrib(m_display, config, EGL_CONFIG_ID, &surfaceConfigId);
+ ASSERT(success == EGL_TRUE);
+ ASSERT(surfaceConfigId != EGL_BAD_ATTRIBUTE);
+
+ ASSERT(!m_surfaceConfigIds.contains(surface));
+ m_surfaceConfigIds.set(surface, surfaceConfigId);
+ return surface;
+}
+
EGLSurface EGLDisplayOpenVG::surfaceForWindow(EGLNativeWindowType wId, const EGLConfig& config)
{
if (m_windowSurfaces.contains(wId))
diff --git a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h
index fd8353d..0dff6c9 100644
--- a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h
+++ b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h
@@ -51,6 +51,7 @@ public:
* If no surface could be created and errorCode is zero, this method
* will trigger an assertion by itself. */
EGLSurface createPbufferSurface(const IntSize&, const EGLConfig&, EGLint* errorCode = 0);
+ EGLSurface createPbufferFromClientBuffer(EGLClientBuffer, EGLenum bufferType, const EGLConfig&, EGLint* errorCode = 0);
EGLSurface surfaceForWindow(EGLNativeWindowType, const EGLConfig&);
diff --git a/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp b/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp
index 9539f2c..9d395b3 100644
--- a/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp
@@ -64,6 +64,25 @@ SurfaceOpenVG::SurfaceOpenVG(const IntSize& size, const EGLDisplay& display, EGL
EGLDisplayOpenVG::registerPlatformSurface(this);
}
+SurfaceOpenVG::SurfaceOpenVG(EGLClientBuffer buffer, EGLenum bufferType, const EGLDisplay& display, EGLConfig* confPtr, EGLint* errorCode)
+ : m_activePainter(0)
+ , m_eglDisplay(display)
+ , m_eglSurface(EGL_NO_SURFACE)
+ , m_eglContext(EGL_NO_CONTEXT)
+{
+ ASSERT(m_eglDisplay != EGL_NO_DISPLAY);
+
+ EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::forDisplay(m_eglDisplay);
+ EGLConfig config = confPtr ? (*confPtr) : displayManager->defaultPbufferConfig();
+ m_eglSurface = displayManager->createPbufferFromClientBuffer(buffer, bufferType, config, errorCode);
+
+ if (m_eglSurface == EGL_NO_SURFACE)
+ return;
+
+ m_eglContext = displayManager->contextForSurface(m_eglSurface);
+ EGLDisplayOpenVG::registerPlatformSurface(this);
+}
+
SurfaceOpenVG::SurfaceOpenVG(EGLNativeWindowType window, const EGLDisplay& display, EGLConfig* confPtr)
: m_activePainter(0)
, m_eglDisplay(display)
diff --git a/WebCore/platform/graphics/openvg/SurfaceOpenVG.h b/WebCore/platform/graphics/openvg/SurfaceOpenVG.h
index b3cc0ce..196e83d 100644
--- a/WebCore/platform/graphics/openvg/SurfaceOpenVG.h
+++ b/WebCore/platform/graphics/openvg/SurfaceOpenVG.h
@@ -67,6 +67,26 @@ public:
SurfaceOpenVG(const IntSize& size, const EGLDisplay& display, EGLConfig* config = 0, EGLint* errorCode = 0);
/**
+ * Create a new EGL pbuffer surface that will be bound to the given
+ * client buffer (read: VGImage), with the specified config on the
+ * given display. If config is not specified, the display's default
+ * pbuffer config is used.
+ *
+ * After the surface is created, you will only be able to access the
+ * client buffer image if the surface is not current. The recommended way
+ * to ensure this is to call surface->sharedSurface()->makeCurrent() if you
+ * simply want to access the image's pixel contents, or if you intend to
+ * draw the image directly, making the draw target surface current.
+ *
+ * This constructor will trigger an assertion if creation of the surface
+ * fails, unless you pledge to manually process the error code by passing
+ * a non-zero pointer as errorCode parameter. The error code returned by
+ * eglGetError() will be written to that variable.
+ */
+ SurfaceOpenVG(EGLClientBuffer buffer, EGLenum bufferType,
+ const EGLDisplay& display, EGLConfig* config = 0, EGLint* errorCode = 0);
+
+ /**
* Create a new EGL window surface with the specified native window handle
* and config on the given display. If config is not specified, the
* display's default window config is used.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list