webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSourceSymbian.cpp
changeset 10 a359256acfc6
parent 0 dd21522fd290
child 40 8bfb9186a8b8
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    99 
    99 
   100 const String& ImageSource::getMimeType()
   100 const String& ImageSource::getMimeType()
   101 {
   101 {
   102     return m_mimeType;    
   102     return m_mimeType;    
   103 }
   103 }
   104 void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
   104 void ImageSource::setDataL(SharedBuffer* data, bool allDataReceived)
   105 {
   105 {
   106     // Make the decoder by sniffing the bytes.
   106     // Make the decoder by sniffing the bytes.
   107     // This method will examine the data and instantiate an instance of the appropriate decoder plugin.
   107     // This method will examine the data and instantiate an instance of the appropriate decoder plugin.
   108     // If insufficient bytes are available to determine the image type, no decoder plugin will be
   108     // If insufficient bytes are available to determine the image type, no decoder plugin will be
   109     // made.
   109     // made.
   110     if( !allDataReceived ) return;
   110     if( !allDataReceived ) return;
   111     if( !m_decoder )
   111     if( !m_decoder )
   112         // sync decoding if no observer is passed
   112         // sync decoding if no observer is passed
   113         TRAP_IGNORE( m_decoder = CAnimationDecoder::NewL( NULL ) );
   113         m_decoder = CAnimationDecoder::NewL( NULL );
   114     if( m_decoder ) {
   114     if( m_decoder ) {
   115         TPtrC8 ptr( (const TUint8*)data->data(), data->size() );
   115         TPtrC8 ptr( (const TUint8*)data->data(), data->size() );
   116         TPtrC16 ptr16(m_mimeType.des());        
   116         TPtrC16 ptr16(m_mimeType.des());        
   117         TRAP_IGNORE( m_decoder->OpenL( ptr, &ptr16, ETrue ) );
   117         m_decoder->OpenL( ptr, &ptr16, ETrue );
   118     }
   118     }
   119 }
   119 }
   120 
   120 
   121 bool ImageSource::isSizeAvailable()
   121 bool ImageSource::isSizeAvailable()
   122 {
   122 {