147 invalidateContext(); 148 invalidateCurrentContext(); 149 150 setScratchSurface(config); 151 152 // restore the state on the native level 153 rq.ensureCapacity(4); 154 buf.putInt(RESTORE_STATE); 155 rq.flushNow(); 156 } 157 158 static class OGLContextCaps extends ContextCapabilities { 159 /** 160 * Indicates the presence of the GL_EXT_framebuffer_object extension. 161 * This cap will only be set if the fbobject system property has been 162 * enabled and we are able to create an FBO with depth buffer. 163 */ 164 @Native 165 static final int CAPS_EXT_FBOBJECT = 166 (CAPS_RT_TEXTURE_ALPHA | CAPS_RT_TEXTURE_OPAQUE); 167 /** Indicates that the context supports a stored alpha channel. */ 168 @Native 169 static final int CAPS_STORED_ALPHA = CAPS_RT_PLAIN_ALPHA; 170 /** Indicates that the context is doublebuffered. */ 171 @Native 172 static final int CAPS_DOUBLEBUFFERED = (FIRST_PRIVATE_CAP << 0); 173 /** 174 * Indicates the presence of the GL_ARB_fragment_shader extension. 175 * This cap will only be set if the lcdshader system property has been 176 * enabled and the hardware supports the minimum number of texture units 177 */ 178 @Native 179 static final int CAPS_EXT_LCD_SHADER = (FIRST_PRIVATE_CAP << 1); 180 /** 181 * Indicates the presence of the GL_ARB_fragment_shader extension. 182 * This cap will only be set if the biopshader system property has been 183 * enabled and the hardware meets our minimum requirements. 184 */ 185 @Native 186 static final int CAPS_EXT_BIOP_SHADER = (FIRST_PRIVATE_CAP << 2); 187 /** 188 * Indicates the presence of the GL_ARB_fragment_shader extension. 189 * This cap will only be set if the gradshader system property has been 190 * enabled and the hardware meets our minimum requirements. 191 */ 192 @Native 193 static final int CAPS_EXT_GRAD_SHADER = (FIRST_PRIVATE_CAP << 3); 194 /** Indicates the presence of the GL_ARB_texture_rectangle extension. */ 195 @Native 196 static final int CAPS_EXT_TEXRECT = (FIRST_PRIVATE_CAP << 4); 197 198 OGLContextCaps(int caps, String adapterId) { 199 super(caps, adapterId); 200 } 201 202 @Override 203 public String toString() { 204 StringBuilder sb = new StringBuilder(super.toString()); 205 if ((caps & CAPS_EXT_FBOBJECT) != 0) { 206 sb.append("CAPS_EXT_FBOBJECT|"); 207 } 208 if ((caps & CAPS_STORED_ALPHA) != 0) { 209 sb.append("CAPS_STORED_ALPHA|"); 210 } 211 if ((caps & CAPS_DOUBLEBUFFERED) != 0) { 212 sb.append("CAPS_DOUBLEBUFFERED|"); 213 } 214 if ((caps & CAPS_EXT_LCD_SHADER) != 0) { 215 sb.append("CAPS_EXT_LCD_SHADER|"); 216 } 217 if ((caps & CAPS_EXT_BIOP_SHADER) != 0) { 218 sb.append("CAPS_BIOP_SHADER|"); 219 } 220 if ((caps & CAPS_EXT_GRAD_SHADER) != 0) { 221 sb.append("CAPS_EXT_GRAD_SHADER|"); 222 } 223 if ((caps & CAPS_EXT_TEXRECT) != 0) { 224 sb.append("CAPS_EXT_TEXRECT|"); 225 } 226 return sb.toString(); 227 } 228 } 229 } | 147 invalidateContext(); 148 invalidateCurrentContext(); 149 150 setScratchSurface(config); 151 152 // restore the state on the native level 153 rq.ensureCapacity(4); 154 buf.putInt(RESTORE_STATE); 155 rq.flushNow(); 156 } 157 158 static class OGLContextCaps extends ContextCapabilities { 159 /** 160 * Indicates the presence of the GL_EXT_framebuffer_object extension. 161 * This cap will only be set if the fbobject system property has been 162 * enabled and we are able to create an FBO with depth buffer. 163 */ 164 @Native 165 static final int CAPS_EXT_FBOBJECT = 166 (CAPS_RT_TEXTURE_ALPHA | CAPS_RT_TEXTURE_OPAQUE); 167 /** Indicates that the context is doublebuffered. */ 168 @Native 169 static final int CAPS_DOUBLEBUFFERED = (FIRST_PRIVATE_CAP << 0); 170 /** 171 * Indicates the presence of the GL_ARB_fragment_shader extension. 172 * This cap will only be set if the lcdshader system property has been 173 * enabled and the hardware supports the minimum number of texture units 174 */ 175 @Native 176 static final int CAPS_EXT_LCD_SHADER = (FIRST_PRIVATE_CAP << 1); 177 /** 178 * Indicates the presence of the GL_ARB_fragment_shader extension. 179 * This cap will only be set if the biopshader system property has been 180 * enabled and the hardware meets our minimum requirements. 181 */ 182 @Native 183 static final int CAPS_EXT_BIOP_SHADER = (FIRST_PRIVATE_CAP << 2); 184 /** 185 * Indicates the presence of the GL_ARB_fragment_shader extension. 186 * This cap will only be set if the gradshader system property has been 187 * enabled and the hardware meets our minimum requirements. 188 */ 189 @Native 190 static final int CAPS_EXT_GRAD_SHADER = (FIRST_PRIVATE_CAP << 3); 191 /** Indicates the presence of the GL_ARB_texture_rectangle extension. */ 192 @Native 193 static final int CAPS_EXT_TEXRECT = (FIRST_PRIVATE_CAP << 4); 194 195 OGLContextCaps(int caps, String adapterId) { 196 super(caps, adapterId); 197 } 198 199 @Override 200 public String toString() { 201 StringBuilder sb = new StringBuilder(super.toString()); 202 if ((caps & CAPS_EXT_FBOBJECT) != 0) { 203 sb.append("CAPS_EXT_FBOBJECT|"); 204 } 205 if ((caps & CAPS_DOUBLEBUFFERED) != 0) { 206 sb.append("CAPS_DOUBLEBUFFERED|"); 207 } 208 if ((caps & CAPS_EXT_LCD_SHADER) != 0) { 209 sb.append("CAPS_EXT_LCD_SHADER|"); 210 } 211 if ((caps & CAPS_EXT_BIOP_SHADER) != 0) { 212 sb.append("CAPS_BIOP_SHADER|"); 213 } 214 if ((caps & CAPS_EXT_GRAD_SHADER) != 0) { 215 sb.append("CAPS_EXT_GRAD_SHADER|"); 216 } 217 if ((caps & CAPS_EXT_TEXRECT) != 0) { 218 sb.append("CAPS_EXT_TEXRECT|"); 219 } 220 return sb.toString(); 221 } 222 } 223 } |