modules/graphics/src/main/java/com/sun/prism/es2/ES2ResourceFactory.java

Print this page




 135     public Texture createTexture(MediaFrame frame) {
 136         return ES2Texture.create(context, frame);
 137     }
 138 
 139     public int getRTTWidth(int w, WrapMode wrapMode) {
 140         return ES2RTTexture.getCompatibleDimension(context, w, wrapMode);
 141     }
 142 
 143     public int getRTTHeight(int h, WrapMode wrapMode) {
 144         return ES2RTTexture.getCompatibleDimension(context, h, wrapMode);
 145     }
 146 
 147     public RTTexture createRTTexture(int width, int height, WrapMode wrapMode) {
 148         return createRTTexture(width, height, wrapMode, false);
 149     }
 150 
 151     public RTTexture createRTTexture(int width, int height, WrapMode wrapMode, boolean msaa) {
 152         return ES2RTTexture.create(context, width, height, wrapMode, msaa);
 153     }
 154 







 155     public boolean isFormatSupported(PixelFormat format) {
 156         GLFactory glFactory = ES2Pipeline.glFactory;
 157         switch (format) {
 158             case BYTE_RGB:
 159             case BYTE_GRAY:
 160             case BYTE_ALPHA:
 161             case MULTI_YCbCr_420:
 162                 return true;
 163             case BYTE_BGRA_PRE:
 164             case INT_ARGB_PRE:
 165                 if (glFactory.isGL2() || PlatformUtil.isIOS()) {
 166                     return true;
 167                 } else {
 168                     // for OpenGLES, BGRA can be supported by extension - if
 169                     // we have it, use it
 170                     return glFactory.isGLExtensionSupported("GL_EXT_texture_format_BGRA8888");
 171                 }
 172             case FLOAT_XYZW:
 173                 return glFactory.isGL2()
 174                     // Unfortunately our support for float textures on GLES




 135     public Texture createTexture(MediaFrame frame) {
 136         return ES2Texture.create(context, frame);
 137     }
 138 
 139     public int getRTTWidth(int w, WrapMode wrapMode) {
 140         return ES2RTTexture.getCompatibleDimension(context, w, wrapMode);
 141     }
 142 
 143     public int getRTTHeight(int h, WrapMode wrapMode) {
 144         return ES2RTTexture.getCompatibleDimension(context, h, wrapMode);
 145     }
 146 
 147     public RTTexture createRTTexture(int width, int height, WrapMode wrapMode) {
 148         return createRTTexture(width, height, wrapMode, false);
 149     }
 150 
 151     public RTTexture createRTTexture(int width, int height, WrapMode wrapMode, boolean msaa) {
 152         return ES2RTTexture.create(context, width, height, wrapMode, msaa);
 153     }
 154 
 155     public RTTexture createRTTexture(int width, int height, Texture.WrapMode wrapMode,
 156             boolean msaa, boolean linearFilter) {
 157         RTTexture rtt = ES2RTTexture.create(context, width, height, wrapMode, msaa);
 158         rtt.setLinearFiltering(linearFilter);
 159         return rtt;
 160     }
 161 
 162     public boolean isFormatSupported(PixelFormat format) {
 163         GLFactory glFactory = ES2Pipeline.glFactory;
 164         switch (format) {
 165             case BYTE_RGB:
 166             case BYTE_GRAY:
 167             case BYTE_ALPHA:
 168             case MULTI_YCbCr_420:
 169                 return true;
 170             case BYTE_BGRA_PRE:
 171             case INT_ARGB_PRE:
 172                 if (glFactory.isGL2() || PlatformUtil.isIOS()) {
 173                     return true;
 174                 } else {
 175                     // for OpenGLES, BGRA can be supported by extension - if
 176                     // we have it, use it
 177                     return glFactory.isGLExtensionSupported("GL_EXT_texture_format_BGRA8888");
 178                 }
 179             case FLOAT_XYZW:
 180                 return glFactory.isGL2()
 181                     // Unfortunately our support for float textures on GLES