changeset 4016:b4e20fb245b3

RT-26106 missing gradient fill
author "Joseph Andresen<joseph.andresen@oracle.com>"
date Wed, 19 Jun 2013 11:40:02 -0700
parents 45f064ac1724
children 3bcb92caeb77
files prism-es2/src/com/sun/prism/es2/ES2RTTexture.java
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/prism-es2/src/com/sun/prism/es2/ES2RTTexture.java	Wed Jun 19 08:45:51 2013 -0700
+++ b/prism-es2/src/com/sun/prism/es2/ES2RTTexture.java	Wed Jun 19 11:40:02 2013 -0700
@@ -279,8 +279,18 @@
     public boolean readPixels(Buffer pixels) {
         context.flushVertexBuffer();
         GLContext glContext = context.getGLContext();
-        return glContext.readPixels(pixels, getContentX(), getContentY(),
-                getContentWidth(), getContentHeight());
+        int id = glContext.getBoundFBO();
+        int fboID = getFboID();
+        boolean changeBoundFBO = id != fboID;
+        if (changeBoundFBO) {
+            glContext.bindFBO(fboID);
+        }
+        boolean result = glContext.readPixels(pixels, getContentX(), getContentY(),
+                 getContentWidth(), getContentHeight());                
+        if (changeBoundFBO) {
+            glContext.bindFBO(id);
+        }
+        return result;
     }
 
     public int getFboID() {