modules/graphics/src/main/java/com/sun/prism/impl/BaseContext.java

Print this page




  95      *
  96      * This method will call releaseRenderTarget method to reset last
  97      * renderTarget and textures if g is null
  98      */
  99     public void setRenderTarget(BaseGraphics g) {
 100         if (g != null) {
 101             setRenderTarget(g.getRenderTarget(), g.getCameraNoClone(),
 102                     g.isDepthTest() && g.isDepthBuffer(), g.isState3D());
 103         } else {
 104             releaseRenderTarget();
 105         }
 106     }
 107 
 108     protected void releaseRenderTarget() {
 109         // Default implementation is a no-op. A pipeline may override if needed.
 110     }
 111 
 112     protected abstract void setRenderTarget(RenderTarget target, NGCamera camera,
 113                                             boolean depthTest, boolean state3D);
 114 
 115     public void validateClearOp(BaseGraphics g) {
 116         validatePaintOp(g, BaseTransform.IDENTITY_TRANSFORM, null, 0, 0, 0, 0);
 117     }
 118 
 119     public abstract void validatePaintOp(BaseGraphics g, BaseTransform xform,
 120                                          Texture maskTex,
 121                                          float bx, float by, float bw, float bh);
 122 
 123     public abstract void validateTextureOp(BaseGraphics g, BaseTransform xform,
 124                                            Texture src, PixelFormat format);
 125 
 126     public void clearGlyphCaches() {
 127         clearCaches(greyGlyphCaches);
 128         clearCaches(lcdGlyphCaches);
 129     }
 130 
 131     private void clearCaches(Map<FontStrike, GlyphCache> glyphCaches) {
 132         for (Iterator<FontStrike> iter = glyphCaches.keySet().iterator(); iter.hasNext();) {
 133             iter.next().clearDesc();
 134         }
 135 
 136         for (GlyphCache cache : glyphCaches.values()) {
 137             if (cache != null) {




  95      *
  96      * This method will call releaseRenderTarget method to reset last
  97      * renderTarget and textures if g is null
  98      */
  99     public void setRenderTarget(BaseGraphics g) {
 100         if (g != null) {
 101             setRenderTarget(g.getRenderTarget(), g.getCameraNoClone(),
 102                     g.isDepthTest() && g.isDepthBuffer(), g.isState3D());
 103         } else {
 104             releaseRenderTarget();
 105         }
 106     }
 107 
 108     protected void releaseRenderTarget() {
 109         // Default implementation is a no-op. A pipeline may override if needed.
 110     }
 111 
 112     protected abstract void setRenderTarget(RenderTarget target, NGCamera camera,
 113                                             boolean depthTest, boolean state3D);
 114 
 115     public abstract void validateClearOp(BaseGraphics g);


 116 
 117     public abstract void validatePaintOp(BaseGraphics g, BaseTransform xform,
 118                                          Texture maskTex,
 119                                          float bx, float by, float bw, float bh);
 120 
 121     public abstract void validateTextureOp(BaseGraphics g, BaseTransform xform,
 122                                            Texture src, PixelFormat format);
 123 
 124     public void clearGlyphCaches() {
 125         clearCaches(greyGlyphCaches);
 126         clearCaches(lcdGlyphCaches);
 127     }
 128 
 129     private void clearCaches(Map<FontStrike, GlyphCache> glyphCaches) {
 130         for (Iterator<FontStrike> iter = glyphCaches.keySet().iterator(); iter.hasNext();) {
 131             iter.next().clearDesc();
 132         }
 133 
 134         for (GlyphCache cache : glyphCaches.values()) {
 135             if (cache != null) {