Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91d26f6c authored by John Hoford's avatar John Hoford
Browse files

tiny planet fix

bug:8323524
Change-Id: I39283face7079574dbe25e797323a84141930f9a
parent eeb5b71b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ inline void InterpolatePixel(const ImageRGBA &image, float x, float y,
             ax * ay * p2[4] + axn * ay * p2[0] + 0.5f);
  p++;
  p2++;
  dest[3] = 0xFF;
}

// Wrap circular coordinates around the globe
+9 −1
Original line number Diff line number Diff line
package com.android.gallery3d.filtershow;

import android.view.View;
import android.view.ViewParent;
import android.widget.FrameLayout;

import com.android.gallery3d.filtershow.cache.ImageLoader;
@@ -49,7 +50,14 @@ public class EditorPlaceHolder {
            editor.setImageLoader(mImageLoader);
            mContainer.setVisibility(View.VISIBLE);
            mContainer.removeAllViews();
            mContainer.addView(editor.getTopLevelView());
            View eview = editor.getTopLevelView();
            ViewParent parent = eview.getParent();

            if (parent != null && parent instanceof FrameLayout) {
                ((FrameLayout) parent).removeAllViews();
            }

            mContainer.addView(eview);
            hideOldViews();
            editor.setVisibility(View.VISIBLE);
            return editor;
+2 −1
Original line number Diff line number Diff line
@@ -482,7 +482,8 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
            if (mAction == CROP_ACTION) {
                mPanelController.showComponent(findViewById(EditorCrop.ID));
            } else if (mAction == TINY_PLANET_ACTION) {
                mPanelController.showComponent(findViewById(EditorTinyPlanet.ID));
                FilterIconButton button = (FilterIconButton) findViewById(EditorTinyPlanet.ID);
                button.onClick(button);
            }
            super.onPostExecute(result);
        }
+10 −4
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@ import android.graphics.Bitmap;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.RenderScript;
import android.util.Log;

import com.android.gallery3d.filtershow.filters.FiltersManager;
import com.android.gallery3d.filtershow.filters.ImageFilterGeometry;
import com.android.gallery3d.filtershow.filters.ImageFilterRS;
import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
import com.android.gallery3d.filtershow.imageshow.MasterImage;
import com.android.gallery3d.filtershow.presets.FilterEnvironment;
@@ -357,19 +357,25 @@ public class CachingPipeline {
            Bitmap resizedOriginalBitmap = mResizedOriginalBitmap;
            if (updateOriginalAllocation(preset)) {
                resizedOriginalBitmap = mResizedOriginalBitmap;
                buffer.updateBitmaps(resizedOriginalBitmap);
                mEnvironment.cache(buffer.getProducer());
                buffer.updateProducerBitmap(resizedOriginalBitmap);
            }
            Bitmap bitmap = buffer.getProducer();
            long time2 = System.currentTimeMillis();

            if (bitmap == null || (bitmap.getWidth() != resizedOriginalBitmap.getWidth())
                    || (bitmap.getHeight() != resizedOriginalBitmap.getHeight())) {
                buffer.updateBitmaps(resizedOriginalBitmap);
                mEnvironment.cache(buffer.getProducer());
                buffer.updateProducerBitmap(resizedOriginalBitmap);
                bitmap = buffer.getProducer();
            }
            mOriginalAllocation.copyTo(bitmap);

            bitmap = preset.apply(bitmap, mEnvironment);
            Bitmap tmpbitmap = preset.apply(bitmap, mEnvironment);
            if (tmpbitmap != bitmap) {
                mEnvironment.cache(buffer.getProducer());
                buffer.setProducer(tmpbitmap);
            }

            mFiltersManager.freeFilterResources(preset);

+8 −0
Original line number Diff line number Diff line
@@ -44,6 +44,14 @@ public class TripleBufferBitmap {
        mIntermediate = mBitmaps[2];
    }

    public synchronized void updateProducerBitmap(Bitmap bitmap) {
        mProducer = bitmap.copy(mBitmapConfig, true);
    }

    public synchronized void setProducer(Bitmap producer) {
        mProducer = producer;
    }

    public synchronized Bitmap getProducer() {
        return mProducer;
    }
Loading