@Override public synchronized void onDestroy() { if (this.bitmap != null) { this.bitmap.decrementRefCount(); } }
@Override public void destroy() { if (this.bitmap != null) { this.bitmap.decrementRefCount(); } }
private void destroyBitmap() { if (bitmap != null) { bitmap.decrementRefCount(); bitmap = null; } }
@Override public void destroy() { if (this.bitmap != null) { this.bitmap.decrementRefCount(); } }
private void destroyBitmaps() { if (this.odBitmap != null) { this.odBitmap.decrementRefCount(); this.odBitmap = null; } if (this.lmBitmap != null) { this.lmBitmap.decrementRefCount(); this.lmBitmap = null; } }
/** * @param bitmap the new {@code Bitmap} of this marker (may be null). */ public synchronized void setBitmap(Bitmap bitmap) { if (this.bitmap != null && this.bitmap.equals(bitmap)) { return; } if (this.bitmap != null) { this.bitmap.decrementRefCount(); } this.bitmap = bitmap; }
/** * Free all resources */ public void destroy() { this.mapScaleBitmap.decrementRefCount(); this.mapScaleCanvas.destroy(); }
@Override public synchronized void onDestroy() { if (this.bitmap != null) { this.bitmap.decrementRefCount(); } }
private void drawParentTileBitmap(Canvas canvas, Point point, Tile tile) { Tile cachedParentTile = getCachedParentTile(tile, 4); if (cachedParentTile != null) { Bitmap bitmap = this.tileCache.getImmediately(createJob(cachedParentTile)); if (bitmap != null) { int tileSize = this.displayModel.getTileSize(); long translateX = tile.getShiftX(cachedParentTile) * tileSize; long translateY = tile.getShiftY(cachedParentTile) * tileSize; byte zoomLevelDiff = (byte) (tile.zoomLevel - cachedParentTile.zoomLevel); float scaleFactor = (float) Math.pow(2, zoomLevelDiff); int x = (int) Math.round(point.x); int y = (int) Math.round(point.y); this.matrix.reset(); this.matrix.translate(x - translateX, y - translateY); this.matrix.scale(scaleFactor, scaleFactor); canvas.setClip(x, y, this.displayModel.getTileSize(), this.displayModel.getTileSize()); canvas.drawBitmap(bitmap, this.matrix, this.displayModel.getFilter()); canvas.resetClip(); bitmap.decrementRefCount(); } } }
@Override public void destroy() { if (this.bitmap != null) { this.bitmap.decrementRefCount(); } }
private void destroyBitmap() { if (bitmap != null) { bitmap.decrementRefCount(); bitmap = null; } }
@Override public void destroy() { if (this.bitmap != null) { this.bitmap.decrementRefCount(); } }
private void destroyBitmaps() { if (this.odBitmap != null) { this.odBitmap.decrementRefCount(); this.odBitmap = null; } if (this.lmBitmap != null) { this.lmBitmap.decrementRefCount(); this.lmBitmap = null; } }
@Override public void renderWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) { synchronized (this) { // this needs to be synchronized as we potentially set a shift in the shader and // the shift is particular to the tile when rendered in multi-thread mode Paint fillPaint = getFillPaint(); if (shaderBitmap == null && !bitmapInvalid) { try { shaderBitmap = createBitmap(relativePathPrefix, src); if (shaderBitmap != null) { fillPaint.setBitmapShader(shaderBitmap); shaderBitmap.decrementRefCount(); } } catch (IOException ioException) { bitmapInvalid = true; } } fillPaint.setBitmapShaderShift(way.getUpperLeft().getOrigin()); renderCallback.renderArea(renderContext, fillPaint, getStrokePaint(renderContext.rendererJob.tile.zoomLevel), this.level, way); } }
/** * @param bitmap the new {@code Bitmap} of this marker (may be null). */ public synchronized void setBitmap(Bitmap bitmap) { if (this.bitmap != null && this.bitmap.equals(bitmap)) { return; } if (this.bitmap != null) { this.bitmap.decrementRefCount(); } this.bitmap = bitmap; }
protected static void clearCaptionBitmap() { for (Bitmap bitmap : captionViews.values()) { bitmap.decrementRefCount(); } captionViews.clear(); }
@Override public void onDestroy() { handler.removeCallbacks(bitmapChanger); // we need to increment the ref count here as otherwise the bitmap gets // destroyed, but we might need to reuse it when this is only part of // a pause/resume cycle. current.incrementRefCount(); super.onDestroy(); bitmapRed.decrementRefCount(); bitmapGreen.decrementRefCount(); } }
@Override protected void onDestroy() { bubble.decrementRefCount(); super.onDestroy(); } }
@Override protected void onDestroy() { if (bubble != null) bubble.decrementRefCount(); super.onDestroy(); }
/** * Free all resources */ public void destroy() { this.mapScaleBitmap.decrementRefCount(); this.mapScaleCanvas.destroy(); }