Project

General

Profile

« Previous | Next » 

Revision 59540ba2

Added by Leszek Koltunski about 7 years ago

Convert (almost) all remaining Apps to the new API which avoids memory leaks with Surfaces.

Remaining problematic Apps: 15. FBO 16. Star Wars (both leak Tree FBOs) 22. SurfaceView (does not work at all after going to background)

View differences:

src/main/java/org/distorted/examples/blur/BlurRenderer.java
48 48
class BlurRenderer implements GLSurfaceView.Renderer
49 49
{
50 50
    private GLSurfaceView mView;
51
    private DistortedTexture mTexture;
51 52
    private DistortedEffects mEffects;
52 53
    private DistortedEffectsPostprocess mPostEffects;
53 54
    private DistortedScreen mScreen;
......
137 138
      bmpHeight = bitmap.getHeight();
138 139
      bmpWidth  = bitmap.getWidth();
139 140

  
140
      DistortedTexture texture = new DistortedTexture(bmpWidth,bmpHeight);
141
      texture.setTexture(bitmap);
141
      if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight);
142
      mTexture.setTexture(bitmap);
142 143

  
143 144
      mScreen.detachAll();
144
      DistortedNode node = new DistortedNode(texture,mEffects,mMesh);
145
      DistortedNode node = new DistortedNode(mTexture,mEffects,mMesh);
145 146
      node.setPostprocessEffects(mPostEffects);
146 147
      mScreen.attach(node);
147 148

  

Also available in: Unified diff