导航菜单

页面标题

页面副标题

St.John's v1.0.9 - LineChartRenderer.java 源代码

正在查看: St.John's v1.0.9 应用的 LineChartRenderer.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.github.mikephil.charting.renderer;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.drawable.Drawable;
import com.github.mikephil.charting.animation.ChartAnimator;
import com.github.mikephil.charting.data.DataSet;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider;
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
import com.github.mikephil.charting.utils.Transformer;
import com.github.mikephil.charting.utils.ViewPortHandler;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import java.lang.ref.WeakReference;
import java.util.List;

public class LineChartRenderer extends LineRadarRenderer {
    protected Path cubicFillPath;
    protected Path cubicPath;
    protected Canvas mBitmapCanvas;
    protected Bitmap.Config mBitmapConfig;
    protected LineDataProvider mChart;
    protected Paint mCirclePaintInner;
    protected WeakReference<Bitmap> mDrawBitmap;
    private float[] mLineBuffer;

    @Override
    public void initBuffers() {
    }

    public LineChartRenderer(LineDataProvider lineDataProvider, ChartAnimator chartAnimator, ViewPortHandler viewPortHandler) {
        super(chartAnimator, viewPortHandler);
        this.mBitmapConfig = Bitmap.Config.ARGB_8888;
        this.cubicPath = new Path();
        this.cubicFillPath = new Path();
        this.mLineBuffer = new float[4];
        this.mChart = lineDataProvider;
        Paint paint = new Paint(1);
        this.mCirclePaintInner = paint;
        paint.setStyle(Paint.Style.FILL);
        this.mCirclePaintInner.setColor(-1);
    }

    @Override
    public void drawData(Canvas canvas) {
        int chartWidth = (int) this.mViewPortHandler.getChartWidth();
        int chartHeight = (int) this.mViewPortHandler.getChartHeight();
        WeakReference<Bitmap> weakReference = this.mDrawBitmap;
        if (weakReference == null || weakReference.get().getWidth() != chartWidth || this.mDrawBitmap.get().getHeight() != chartHeight) {
            if (chartWidth <= 0 || chartHeight <= 0) {
                return;
            }
            this.mDrawBitmap = new WeakReference<>(Bitmap.createBitmap(chartWidth, chartHeight, this.mBitmapConfig));
            this.mBitmapCanvas = new Canvas(this.mDrawBitmap.get());
        }
        this.mDrawBitmap.get().eraseColor(0);
        for (T t : this.mChart.getLineData().getDataSets()) {
            if (t.isVisible() && t.getEntryCount() > 0) {
                drawDataSet(canvas, t);
            }
        }
        canvas.drawBitmap(this.mDrawBitmap.get(), BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, this.mRenderPaint);
    }

    protected void drawDataSet(Canvas canvas, ILineDataSet iLineDataSet) {
        if (iLineDataSet.getEntryCount() < 1) {
            return;
        }
        this.mRenderPaint.setStrokeWidth(iLineDataSet.getLineWidth());
        this.mRenderPaint.setPathEffect(iLineDataSet.getDashPathEffect());
        if (iLineDataSet.isDrawCubicEnabled()) {
            drawCubic(canvas, iLineDataSet);
        } else {
            drawLinear(canvas, iLineDataSet);
        }
        this.mRenderPaint.setPathEffect(null);
    }

    protected void drawCubic(Canvas canvas, ILineDataSet iLineDataSet) {
        Transformer transformer = this.mChart.getTransformer(iLineDataSet.getAxisDependency());
        int entryCount = iLineDataSet.getEntryCount();
        T entryForXIndex = iLineDataSet.getEntryForXIndex(this.mMinX < 0 ? 0 : this.mMinX, DataSet.Rounding.DOWN);
        T entryForXIndex2 = iLineDataSet.getEntryForXIndex(this.mMaxX, DataSet.Rounding.UP);
        int i = 1;
        int max = Math.max(iLineDataSet.getEntryIndex(entryForXIndex) - (entryForXIndex == entryForXIndex2 ? 1 : 0), 0);
        int min = Math.min(Math.max(max + 2, iLineDataSet.getEntryIndex(entryForXIndex2) + 1), entryCount);
        float phaseX = this.mAnimator.getPhaseX();
        float phaseY = this.mAnimator.getPhaseY();
        float cubicIntensity = iLineDataSet.getCubicIntensity();
        this.cubicPath.reset();
        int ceil = (int) Math.ceil(((min - max) * phaseX) + max);
        if (ceil - max >= 2) {
            ?? entryForIndex = iLineDataSet.getEntryForIndex(max);
            int i2 = max + 1;
            iLineDataSet.getEntryForIndex(i2);
            this.cubicPath.moveTo(entryForIndex.getXIndex(), entryForIndex.getVal() * phaseY);
            int i3 = entryCount - 1;
            int min2 = Math.min(ceil, i3);
            while (i2 < min2) {
                ?? entryForIndex2 = iLineDataSet.getEntryForIndex(i2 == i ? 0 : i2 - 2);
                ?? entryForIndex3 = iLineDataSet.getEntryForIndex(i2 - 1);
                ?? entryForIndex4 = iLineDataSet.getEntryForIndex(i2);
                i2++;
                this.cubicPath.cubicTo(entryForIndex3.getXIndex() + ((entryForIndex4.getXIndex() - entryForIndex2.getXIndex()) * cubicIntensity), (entryForIndex3.getVal() + ((entryForIndex4.getVal() - entryForIndex2.getVal()) * cubicIntensity)) * phaseY, entryForIndex4.getXIndex() - ((r17.getXIndex() - entryForIndex3.getXIndex()) * cubicIntensity), (entryForIndex4.getVal() - ((iLineDataSet.getEntryForIndex(i2).getVal() - entryForIndex3.getVal()) * cubicIntensity)) * phaseY, entryForIndex4.getXIndex(), entryForIndex4.getVal() * phaseY);
                i = 1;
            }
            if (ceil > i3) {
                ?? entryForIndex5 = iLineDataSet.getEntryForIndex(entryCount >= 3 ? entryCount - 3 : entryCount - 2);
                ?? entryForIndex6 = iLineDataSet.getEntryForIndex(entryCount - 2);
                ?? entryForIndex7 = iLineDataSet.getEntryForIndex(i3);
                this.cubicPath.cubicTo(entryForIndex6.getXIndex() + ((entryForIndex7.getXIndex() - entryForIndex5.getXIndex()) * cubicIntensity), (entryForIndex6.getVal() + ((entryForIndex7.getVal() - entryForIndex5.getVal()) * cubicIntensity)) * phaseY, entryForIndex7.getXIndex() - ((entryForIndex7.getXIndex() - entryForIndex6.getXIndex()) * cubicIntensity), (entryForIndex7.getVal() - ((entryForIndex7.getVal() - entryForIndex6.getVal()) * cubicIntensity)) * phaseY, entryForIndex7.getXIndex(), entryForIndex7.getVal() * phaseY);
            }
        }
        if (iLineDataSet.isDrawFilledEnabled()) {
            this.cubicFillPath.reset();
            this.cubicFillPath.addPath(this.cubicPath);
            drawCubicFill(this.mBitmapCanvas, iLineDataSet, this.cubicFillPath, transformer, max, ceil);
        }
        this.mRenderPaint.setColor(iLineDataSet.getColor());
        this.mRenderPaint.setStyle(Paint.Style.STROKE);
        transformer.pathValueToPixel(this.cubicPath);
        this.mBitmapCanvas.drawPath(this.cubicPath, this.mRenderPaint);
        this.mRenderPaint.setPathEffect(null);
    }

    protected void drawCubicFill(Canvas canvas, ILineDataSet iLineDataSet, Path path, Transformer transformer, int i, int i2) {
        if (i2 - i <= 1) {
            return;
        }
        float fillLinePosition = iLineDataSet.getFillFormatter().getFillLinePosition(iLineDataSet, this.mChart);
        ?? entryForIndex = iLineDataSet.getEntryForIndex(i2 - 1);
        ?? entryForIndex2 = iLineDataSet.getEntryForIndex(i);
        float f = BitmapDescriptorFactory.HUE_RED;
        float xIndex = entryForIndex == 0 ? BitmapDescriptorFactory.HUE_RED : entryForIndex.getXIndex();
        if (entryForIndex2 != 0) {
            f = entryForIndex2.getXIndex();
        }
        path.lineTo(xIndex, fillLinePosition);
        path.lineTo(f, fillLinePosition);
        path.close();
        transformer.pathValueToPixel(path);
        Drawable fillDrawable = iLineDataSet.getFillDrawable();
        if (fillDrawable != null) {
            drawFilledPath(canvas, path, fillDrawable);
        } else {
            drawFilledPath(canvas, path, iLineDataSet.getFillColor(), iLineDataSet.getFillAlpha());
        }
    }

    protected void drawLinear(Canvas canvas, ILineDataSet iLineDataSet) {
        boolean z;
        char c;
        int entryCount = iLineDataSet.getEntryCount();
        boolean isDrawSteppedEnabled = iLineDataSet.isDrawSteppedEnabled();
        int i = isDrawSteppedEnabled ? 4 : 2;
        Transformer transformer = this.mChart.getTransformer(iLineDataSet.getAxisDependency());
        float phaseX = this.mAnimator.getPhaseX();
        float phaseY = this.mAnimator.getPhaseY();
        this.mRenderPaint.setStyle(Paint.Style.STROKE);
        Canvas canvas2 = iLineDataSet.isDashedLineEnabled() ? this.mBitmapCanvas : canvas;
        T entryForXIndex = iLineDataSet.getEntryForXIndex(this.mMinX < 0 ? 0 : this.mMinX, DataSet.Rounding.DOWN);
        T entryForXIndex2 = iLineDataSet.getEntryForXIndex(this.mMaxX, DataSet.Rounding.UP);
        int max = Math.max(iLineDataSet.getEntryIndex(entryForXIndex) - (entryForXIndex == entryForXIndex2 ? 1 : 0), 0);
        int min = Math.min(Math.max(max + 2, iLineDataSet.getEntryIndex(entryForXIndex2) + 1), entryCount);
        int ceil = (int) Math.ceil(((min - max) * phaseX) + max);
        if (iLineDataSet.getColors().size() > 1) {
            int i2 = i * 2;
            if (this.mLineBuffer.length != i2) {
                this.mLineBuffer = new float[i2];
            }
            for (int i3 = max; i3 < ceil && (ceil <= 1 || i3 != ceil - 1); i3++) {
                ?? entryForIndex = iLineDataSet.getEntryForIndex(i3);
                if (entryForIndex != 0) {
                    this.mLineBuffer[0] = entryForIndex.getXIndex();
                    this.mLineBuffer[1] = entryForIndex.getVal() * phaseY;
                    int i4 = i3 + 1;
                    if (i4 < ceil) {
                        ?? entryForIndex2 = iLineDataSet.getEntryForIndex(i4);
                        if (entryForIndex2 == 0) {
                            break;
                        }
                        if (isDrawSteppedEnabled) {
                            this.mLineBuffer[2] = entryForIndex2.getXIndex();
                            float[] fArr = this.mLineBuffer;
                            float f = fArr[1];
                            fArr[3] = f;
                            fArr[4] = fArr[2];
                            fArr[5] = f;
                            fArr[6] = entryForIndex2.getXIndex();
                            this.mLineBuffer[7] = entryForIndex2.getVal() * phaseY;
                        } else {
                            this.mLineBuffer[2] = entryForIndex2.getXIndex();
                            this.mLineBuffer[3] = entryForIndex2.getVal() * phaseY;
                        }
                        c = 0;
                    } else {
                        float[] fArr2 = this.mLineBuffer;
                        c = 0;
                        fArr2[2] = fArr2[0];
                        fArr2[3] = fArr2[1];
                    }
                    transformer.pointValuesToPixel(this.mLineBuffer);
                    if (!this.mViewPortHandler.isInBoundsRight(this.mLineBuffer[c])) {
                        break;
                    }
                    if (this.mViewPortHandler.isInBoundsLeft(this.mLineBuffer[2]) && ((this.mViewPortHandler.isInBoundsTop(this.mLineBuffer[1]) || this.mViewPortHandler.isInBoundsBottom(this.mLineBuffer[3])) && (this.mViewPortHandler.isInBoundsTop(this.mLineBuffer[1]) || this.mViewPortHandler.isInBoundsBottom(this.mLineBuffer[3])))) {
                        this.mRenderPaint.setColor(iLineDataSet.getColor(i3));
                        canvas2.drawLines(this.mLineBuffer, 0, i2, this.mRenderPaint);
                    }
                }
            }
        } else {
            int i5 = (entryCount - 1) * i;
            if (this.mLineBuffer.length != Math.max(i5, i) * 2) {
                this.mLineBuffer = new float[Math.max(i5, i) * 2];
            }
            if (iLineDataSet.getEntryForIndex(max) != 0) {
                int i6 = ceil > 1 ? max + 1 : max;
                int i7 = 0;
                while (i6 < ceil) {
                    ?? entryForIndex3 = iLineDataSet.getEntryForIndex(i6 == 0 ? 0 : i6 - 1);
                    ?? entryForIndex4 = iLineDataSet.getEntryForIndex(i6);
                    if (entryForIndex3 == 0 || entryForIndex4 == 0) {
                        z = isDrawSteppedEnabled;
                    } else {
                        this.mLineBuffer[i7] = entryForIndex3.getXIndex();
                        int i8 = i7 + 2;
                        this.mLineBuffer[i7 + 1] = entryForIndex3.getVal() * phaseY;
                        if (isDrawSteppedEnabled) {
                            this.mLineBuffer[i8] = entryForIndex4.getXIndex();
                            this.mLineBuffer[i7 + 3] = entryForIndex3.getVal() * phaseY;
                            z = isDrawSteppedEnabled;
                            this.mLineBuffer[i7 + 4] = entryForIndex4.getXIndex();
                            this.mLineBuffer[i7 + 5] = entryForIndex3.getVal() * phaseY;
                            i8 = i7 + 6;
                        } else {
                            z = isDrawSteppedEnabled;
                        }
                        this.mLineBuffer[i8] = entryForIndex4.getXIndex();
                        this.mLineBuffer[i8 + 1] = entryForIndex4.getVal() * phaseY;
                        i7 = i8 + 2;
                    }
                    i6++;
                    isDrawSteppedEnabled = z;
                }
                transformer.pointValuesToPixel(this.mLineBuffer);
                int max2 = Math.max(((ceil - max) - 1) * i, i) * 2;
                this.mRenderPaint.setColor(iLineDataSet.getColor());
                canvas2.drawLines(this.mLineBuffer, 0, max2, this.mRenderPaint);
            }
        }
        this.mRenderPaint.setPathEffect(null);
        if (!iLineDataSet.isDrawFilledEnabled() || entryCount <= 0) {
            return;
        }
        drawLinearFill(canvas, iLineDataSet, max, min, transformer);
    }

    protected void drawLinearFill(Canvas canvas, ILineDataSet iLineDataSet, int i, int i2, Transformer transformer) {
        Path generateFilledPath = generateFilledPath(iLineDataSet, i, i2);
        transformer.pathValueToPixel(generateFilledPath);
        Drawable fillDrawable = iLineDataSet.getFillDrawable();
        if (fillDrawable != null) {
            drawFilledPath(canvas, generateFilledPath, fillDrawable);
        } else {
            drawFilledPath(canvas, generateFilledPath, iLineDataSet.getFillColor(), iLineDataSet.getFillAlpha());
        }
    }

    private Path generateFilledPath(ILineDataSet iLineDataSet, int i, int i2) {
        float fillLinePosition = iLineDataSet.getFillFormatter().getFillLinePosition(iLineDataSet, this.mChart);
        float phaseX = this.mAnimator.getPhaseX();
        float phaseY = this.mAnimator.getPhaseY();
        boolean isDrawSteppedEnabled = iLineDataSet.isDrawSteppedEnabled();
        Path path = new Path();
        ?? entryForIndex = iLineDataSet.getEntryForIndex(i);
        path.moveTo(entryForIndex.getXIndex(), fillLinePosition);
        path.lineTo(entryForIndex.getXIndex(), entryForIndex.getVal() * phaseY);
        int ceil = (int) Math.ceil(((i2 - i) * phaseX) + i);
        for (int i3 = i + 1; i3 < ceil; i3++) {
            ?? entryForIndex2 = iLineDataSet.getEntryForIndex(i3);
            if (isDrawSteppedEnabled) {
                ?? entryForIndex3 = iLineDataSet.getEntryForIndex(i3 - 1);
                if (entryForIndex3 != 0) {
                    path.lineTo(entryForIndex2.getXIndex(), entryForIndex3.getVal() * phaseY);
                }
            }
            path.lineTo(entryForIndex2.getXIndex(), entryForIndex2.getVal() * phaseY);
        }
        path.lineTo(iLineDataSet.getEntryForIndex(Math.max(Math.min(((int) Math.ceil(r11)) - 1, iLineDataSet.getEntryCount() - 1), 0)).getXIndex(), fillLinePosition);
        path.close();
        return path;
    }

    @Override
    public void drawValues(Canvas canvas) {
        int i;
        float[] fArr;
        if (this.mChart.getLineData().getYValCount() < this.mChart.getMaxVisibleCount() * this.mViewPortHandler.getScaleX()) {
            List<T> dataSets = this.mChart.getLineData().getDataSets();
            for (int i2 = 0; i2 < dataSets.size(); i2++) {
                ILineDataSet iLineDataSet = (ILineDataSet) dataSets.get(i2);
                if (iLineDataSet.isDrawValuesEnabled() && iLineDataSet.getEntryCount() != 0) {
                    applyValueTextStyle(iLineDataSet);
                    Transformer transformer = this.mChart.getTransformer(iLineDataSet.getAxisDependency());
                    int circleRadius = (int) (iLineDataSet.getCircleRadius() * 1.75f);
                    if (!iLineDataSet.isDrawCirclesEnabled()) {
                        circleRadius /= 2;
                    }
                    int i3 = circleRadius;
                    int entryCount = iLineDataSet.getEntryCount();
                    T entryForXIndex = iLineDataSet.getEntryForXIndex(this.mMinX < 0 ? 0 : this.mMinX, DataSet.Rounding.DOWN);
                    T entryForXIndex2 = iLineDataSet.getEntryForXIndex(this.mMaxX, DataSet.Rounding.UP);
                    int max = Math.max(iLineDataSet.getEntryIndex(entryForXIndex) - (entryForXIndex == entryForXIndex2 ? 1 : 0), 0);
                    float[] generateTransformedValuesLine = transformer.generateTransformedValuesLine(iLineDataSet, this.mAnimator.getPhaseX(), this.mAnimator.getPhaseY(), max, Math.min(Math.max(max + 2, iLineDataSet.getEntryIndex(entryForXIndex2) + 1), entryCount));
                    int i4 = 0;
                    while (i4 < generateTransformedValuesLine.length) {
                        float f = generateTransformedValuesLine[i4];
                        float f2 = generateTransformedValuesLine[i4 + 1];
                        if (!this.mViewPortHandler.isInBoundsRight(f)) {
                            break;
                        }
                        if (this.mViewPortHandler.isInBoundsLeft(f) && this.mViewPortHandler.isInBoundsY(f2)) {
                            int i5 = i4 / 2;
                            ?? entryForIndex = iLineDataSet.getEntryForIndex(i5 + max);
                            i = i4;
                            fArr = generateTransformedValuesLine;
                            drawValue(canvas, iLineDataSet.getValueFormatter(), entryForIndex.getVal(), entryForIndex, i2, f, f2 - i3, iLineDataSet.getValueTextColor(i5));
                        } else {
                            i = i4;
                            fArr = generateTransformedValuesLine;
                        }
                        i4 = i + 2;
                        generateTransformedValuesLine = fArr;
                    }
                }
            }
        }
    }

    @Override
    public void drawExtras(Canvas canvas) {
        drawCircles(canvas);
    }

    protected void drawCircles(Canvas canvas) {
        float f;
        this.mRenderPaint.setStyle(Paint.Style.FILL);
        float phaseX = this.mAnimator.getPhaseX();
        float phaseY = this.mAnimator.getPhaseY();
        List<T> dataSets = this.mChart.getLineData().getDataSets();
        int i = 0;
        int i2 = 0;
        while (i2 < dataSets.size()) {
            ILineDataSet iLineDataSet = (ILineDataSet) dataSets.get(i2);
            if (iLineDataSet.isVisible() && iLineDataSet.isDrawCirclesEnabled() && iLineDataSet.getEntryCount() != 0) {
                this.mCirclePaintInner.setColor(iLineDataSet.getCircleHoleColor());
                Transformer transformer = this.mChart.getTransformer(iLineDataSet.getAxisDependency());
                int entryCount = iLineDataSet.getEntryCount();
                T entryForXIndex = iLineDataSet.getEntryForXIndex(this.mMinX < 0 ? 0 : this.mMinX, DataSet.Rounding.DOWN);
                T entryForXIndex2 = iLineDataSet.getEntryForXIndex(this.mMaxX, DataSet.Rounding.UP);
                char c = 1;
                int max = Math.max(iLineDataSet.getEntryIndex(entryForXIndex) - (entryForXIndex == entryForXIndex2 ? 1 : 0), i);
                int min = Math.min(Math.max(max + 2, iLineDataSet.getEntryIndex(entryForXIndex2) + 1), entryCount);
                float circleRadius = iLineDataSet.getCircleRadius() / 2.0f;
                int ceil = (int) Math.ceil(((min - max) * phaseX) + max);
                while (max < ceil) {
                    ?? entryForIndex = iLineDataSet.getEntryForIndex(max);
                    if (entryForIndex == 0) {
                        break;
                    }
                    float xIndex = entryForIndex.getXIndex();
                    float val = entryForIndex.getVal() * phaseY;
                    float[] fArr = new float[2];
                    fArr[i] = xIndex;
                    fArr[c] = val;
                    transformer.pointValuesToPixel(fArr);
                    if (!this.mViewPortHandler.isInBoundsRight(fArr[i])) {
                        break;
                    }
                    if (this.mViewPortHandler.isInBoundsLeft(fArr[i]) && this.mViewPortHandler.isInBoundsY(fArr[c])) {
                        int circleColor = iLineDataSet.getCircleColor(max);
                        this.mRenderPaint.setColor(circleColor);
                        f = phaseX;
                        canvas.drawCircle(fArr[i], fArr[c], iLineDataSet.getCircleRadius(), this.mRenderPaint);
                        if (!iLineDataSet.isDrawCircleHoleEnabled() || circleColor == this.mCirclePaintInner.getColor()) {
                            c = 1;
                        } else {
                            c = 1;
                            canvas.drawCircle(fArr[0], fArr[1], circleRadius, this.mCirclePaintInner);
                        }
                    } else {
                        f = phaseX;
                    }
                    max++;
                    phaseX = f;
                    i = 0;
                }
            }
            i2++;
            phaseX = phaseX;
            i = 0;
        }
    }

    @Override
    public void drawHighlighted(Canvas canvas, Highlight[] highlightArr) {
        for (int i = 0; i < highlightArr.length; i++) {
            ILineDataSet iLineDataSet = (ILineDataSet) this.mChart.getLineData().getDataSetByIndex(highlightArr[i].getDataSetIndex());
            if (iLineDataSet != null && iLineDataSet.isHighlightEnabled()) {
                int xIndex = highlightArr[i].getXIndex();
                float f = xIndex;
                if (f <= this.mChart.getXChartMax() * this.mAnimator.getPhaseX()) {
                    float yValForXIndex = iLineDataSet.getYValForXIndex(xIndex);
                    if (yValForXIndex != Float.NaN) {
                        float[] fArr = {f, yValForXIndex * this.mAnimator.getPhaseY()};
                        this.mChart.getTransformer(iLineDataSet.getAxisDependency()).pointValuesToPixel(fArr);
                        drawHighlightLines(canvas, fArr, iLineDataSet);
                    }
                }
            }
        }
    }

    public void setBitmapConfig(Bitmap.Config config) {
        this.mBitmapConfig = config;
        releaseBitmap();
    }

    public Bitmap.Config getBitmapConfig() {
        return this.mBitmapConfig;
    }

    public void releaseBitmap() {
        WeakReference<Bitmap> weakReference = this.mDrawBitmap;
        if (weakReference != null) {
            weakReference.get().recycle();
            this.mDrawBitmap.clear();
            this.mDrawBitmap = null;
        }
    }
}