Source/platform/graphics/DeferredImageDecoder.cpp
// Creates a SkBitmap that is backed by SkDiscardablePixelRef.
Creates a SkBitmap that is backed by SkDiscardablePixelRef.
Creates a SkBitmap that is backed by SkDiscardablePixelRef .
SkBitmap DeferredImageDecoder::createBitmap(size_t index)
{
    IntSize decodedSize = m_actualDecoder->decodedSize();
    ASSERT(decodedSize.width() > 0);
    ASSERT(decodedSize.height() > 0);
    SkImageInfo info;
    info.fWidth = decodedSize.width();
    info.fHeight = decodedSize.height();
#if SK_B32_SHIFT 
    info.fColorType = kRGBA_8888_SkColorType;
#else
    info.fColorType = kBGRA_8888_SkColorType;
#endif
    info.fAlphaType = kPremul_SkAlphaType;
    SkBitmap bitmap;
    DecodingImageGenerator* generator = new DecodingImageGenerator(m_frameGenerator, info, index);
    bool installed = SkInstallDiscardablePixelRef(generator, &bitmap);
    ASSERT_UNUSED(installed, installed);
    bitmap.pixelRef()->setURI(labelDiscardable);
    generator->setGenerationId(bitmap.getGenerationID());
    return bitmap;
}
SkBitmap DeferredImageDecoder :: createBitmap ( size_t index ) { IntSize decodedSize = m_actualDecoder -> decodedSize ( ) ; ASSERT ( decodedSize . width ( ) > 0 ) ; ASSERT ( decodedSize . height ( ) > 0 ) ; SkImageInfo info ; info . fWidth = decodedSize . width ( ) ; info . fHeight = decodedSize . height ( ) ; #if SK_B32_SHIFT info . fColorType = kRGBA_8888_SkColorType ; #else info . fColorType = kBGRA_8888_SkColorType ; #endif info . fAlphaType = kPremul_SkAlphaType ; SkBitmap bitmap ; DecodingImageGenerator * generator = new DecodingImageGenerator ( m_frameGenerator , info , index ) ; bool installed = SkInstallDiscardablePixelRef ( generator , & bitmap ) ; ASSERT_UNUSED ( installed , installed ) ; bitmap . pixelRef ( ) -> setURI ( labelDiscardable ) ; generator -> setGenerationId ( bitmap . getGenerationID ( ) ) ; return bitmap ; }
Creates a SkBitmap that is backed by SkDiscardablePixelRef.
Creates a SkBitmap that is backed by SkDiscardablePixelRef .
// Little-endian RGBA pixels. (Android)