/// M: function for release painter @{
void PaintTileOperation::releasePainter(TilePainter* painter)
{
    if (painter && painter->type() == TilePainter::Image) {
        ImageTexture* image = static_cast<ImageTexture*>(painter);
        ImagesManager::instance()->releaseImage(image->imageCRC());
    } else {
        SkSafeUnref(painter);
    }
}
PaintTileOperation::~PaintTileOperation()
{
    if (m_tile) {
        m_tile->setRepaintPending(false);
        m_tile = 0;
    }

    if (m_surface && m_surface->type() == SurfacePainter::ImageSurface) {
        ImageTexture* image = static_cast<ImageTexture*>(m_surface);
        ImagesManager::instance()->releaseImage(image->imageCRC());
    } else {
        SkSafeUnref(m_surface);
    }
}
Exemplo n.º 3
0
void TransferQueue::clearItemInTranferQueue(int index)
{
    m_transferQueue[index].savedTilePtr = 0;
    //SAMSUNG_CHANGES >> - MPSG100005914
    //WAS: SkSafeUnref(m_transferQueue[index].savedTilePainter);
    if (m_transferQueue[index].savedTilePainter && m_transferQueue[index].savedTilePainter->type() == TilePainter::Image) {
        ImageTexture* image = static_cast<ImageTexture*>(m_transferQueue[index].savedTilePainter);
        ImagesManager::instance()->releaseImage(image->imageCRC());
    } else {
        SkSafeUnref(m_transferQueue[index].savedTilePainter);
    }
    //SAMSUNG_CHANGES <<
    m_transferQueue[index].savedTilePainter = 0;
    m_transferQueue[index].status = emptyItem;
}
PaintTileOperation::~PaintTileOperation()
{
    if (m_tile) {
        m_tile->setRepaintPending(false);
        m_tile = 0;
    }

    if (m_painter && m_painter->type() == TilePainter::Image) {
        ImageTexture* image = static_cast<ImageTexture*>(m_painter);
        ImagesManager::instance()->releaseImage(image->imageCRC());
    } else {
        SkSafeUnref(m_painter);
    }
#ifdef DEBUG_COUNT
    ClassTracker::instance()->decrement("PaintTileOperation");
#endif
}
Exemplo n.º 5
0
void LayerAndroid::setContentsImage(SkBitmapRef* img)
{
    ImageTexture* image = ImagesManager::instance()->setImage(img);
    ImagesManager::instance()->releaseImage(m_imageCRC);
    m_imageCRC = image ? image->imageCRC() : 0;
}