gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, openvg, updated. 3f9775d1637ab2ce0f24


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, openvg, updated. 3f9775d1637ab2ce0f24fd5a6a540af3476da85a
Date: Tue, 09 Nov 2010 16:53:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, openvg has been updated
       via  3f9775d1637ab2ce0f24fd5a6a540af3476da85a (commit)
      from  ea7360bf19bdc370537744dad62759fd8ce7e7b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=3f9775d1637ab2ce0f24fd5a6a540af3476da85a


commit 3f9775d1637ab2ce0f24fd5a6a540af3476da85a
Author: Rob Savoye <address@hidden>
Date:   Tue Nov 2 19:27:52 2010 -0600

    add methods for using Pbuffers

diff --git a/librender/eglDevice.h b/librender/eglDevice.h
index dfdeacd..5cb9e81 100644
--- a/librender/eglDevice.h
+++ b/librender/eglDevice.h
@@ -74,15 +74,52 @@ class EGLDevice
     void printEGLContext(EGLContext context);
     void printEGLSurface() { return printEGLSurface(_eglSurface); };
     void printEGLSurface(EGLSurface surface);
-
     
-    // Create a Pbuffer for offscreen rendering
+    // Create Pbuffers for offscreen rendering
     EGLSurface createPbuffer(int width, int height);
     EGLSurface createPbuffer(int width, int height, EGLClientBuffer buf, 
EGLenum type);
     EGLSurface createPixmap(int width, int height, NativePixmapType buf);
     size_t totalPbuffers() { return _pbuffers.size(); };
     EGLSurface &operator[](int index) { return _pbuffers[index]; };
 
+    // Swapping Buffers makes the specified surface active on the display if
+    // EGL_RENDER_BUFFER is set to EGL_BACK_BUFFER. If it's set to
+    // EGL_SINGLE_BUFFER then this has no effect, as the display was drawn to
+    // directly.
+    // Swap to the default surface
+    bool swapPbuffers() {
+        return eglSwapBuffers(_eglDisplay, _eglSurface);
+    }
+    bool copyPbuffers(int x) {
+        if (x < _pbuffers.size()) {
+            NativePixmapType pix;
+            if (!eglCopyBuffers(_eglDisplay, _pbuffers[x], pix)) {
+                log_error( "eglCopyBuffers() failed (error 0x%x)", 
eglGetError());
+                return false;
+            }
+            return true;
+        }
+        return false;
+    }
+    // Make one of the pbuffers the current one to draw into
+    bool makePbufferCurrent() {
+        if (!eglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface, 
_eglContext)) {
+            log_error( "eglMakeCurrent() failed (error 0x%x)", eglGetError());
+            return false;
+        }
+    }
+    
+    bool makePbufferCurrent(int x) {
+        if (x < _pbuffers.size()) {
+            if (!eglMakeCurrent(_eglDisplay, _pbuffers[x], _pbuffers[x], 
_eglContext)) {
+                log_error( "eglMakeCurrent() failed (error 0x%x)", 
eglGetError());
+                return false;
+            }
+            return true;
+        }
+        return false;
+    }
+    
     // Accessors for the settings needed by higher level code.
     // Surface accessors
     EGLint getWidth() {
diff --git a/librender/test_egl.cpp b/librender/test_egl.cpp
index a68dd48..e008f4a 100644
--- a/librender/test_egl.cpp
+++ b/librender/test_egl.cpp
@@ -238,12 +238,6 @@ test_egl(EGLDevice &egl, EGLDevice::rtype_t rtype)
         runtest.fail("EGLDevice::createPbuffer(int, int)");
     }
     
-    if (egl.totalPbuffers()) {
-        runtest.pass("EGLDevice::totalPbuffers()");
-    } else {
-        runtest.fail("EGLDevice::totalPbuffers()");
-    }
-    
     EGLSurface surf1 = egl[0];
     if ((surf1 != EGL_NO_SURFACE) && (egl.getWidth(surf1) == 200)
         && (egl.getHeigth(surf1) == 200)) {
@@ -252,7 +246,48 @@ test_egl(EGLDevice &egl, EGLDevice::rtype_t rtype)
         runtest.fail("EGLDevice::operator[]()");
     }
 
+    EGLSurface surf2 = egl.createPbuffer(300, 300);
+    EGLSurface surf3 = egl.createPbuffer(400, 400);
+
+    if (egl.totalPbuffers() == 3) {
+        runtest.pass("EGLDevice::totalPbuffers(2)");
+    } else {
+        runtest.fail("EGLDevice::totalPbuffers(2)");
+    }
+
+    // Since we're EGL_SINGLE_BUFFER'd, this is a nop
+    if (egl.swapPbuffers()) {
+        runtest.pass("EGLDevice::swapPbuffers()");
+    } else {
+        runtest.fail("EGLDevice::swapPbuffers()");
+    }
 
+    egl.makePbufferCurrent(1);
+    EGLSurface surf4 = eglGetCurrentSurface(EGL_DRAW);
+    if ((egl.getWidth(surf4) == 300) && ((egl.getHeigth(surf4) == 300))) {
+        runtest.pass("EGLDevice::makePbufferCurrent(int)");
+    } else {
+        runtest.fail("EGLDevice::makePbufferCurrent(int)");
+    }
+
+    // This should trigger an error as the number is more than we
+    // have created
+    if (!egl.makePbufferCurrent(10)) {
+        runtest.pass("EGLDevice::makePbufferCurrent(maxed)");
+    } else {
+        runtest.fail("EGLDevice::makePbufferCurrent(maxed)");
+    }
+    
+#if 0
+    if (!egl.copyPbuffers(1)) {
+        runtest.pass("EGLDevice::copyPbuffers()");
+    } else {
+        runtest.fail("EGLDevice::copyPbuffers()");
+    }
+#endif
+    
+    // EGLSurface surf5 = eglGetCurrentSurface(EGL_DRAW);
+    // egl.printEGLSurface(surf5);
 }
 
 // Local Variables:

-----------------------------------------------------------------------

Summary of changes:
 librender/eglDevice.h  |   41 +++++++++++++++++++++++++++++++++++++++--
 librender/test_egl.cpp |   47 +++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 80 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]