X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_webkit;a=blobdiff_plain;f=Source%2FWebCore%2Fplatform%2Fimage-decoders%2FImageDecoder.h;fp=Source%2FWebCore%2Fplatform%2Fimage-decoders%2FImageDecoder.h;h=c562ae4b23a7088a679864a09762a44aed9883e7;hp=7b4847f473a8355422688e00dfa2ecfbb6ad597a;hb=186b2535c234ccc42a8c27998f11be6f718f604f;hpb=1c567be6144228b511852e3cab689fc41b052875 diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.h b/Source/WebCore/platform/image-decoders/ImageDecoder.h index 7b4847f..c562ae4 100644 --- a/Source/WebCore/platform/image-decoders/ImageDecoder.h +++ b/Source/WebCore/platform/image-decoders/ImageDecoder.h @@ -43,10 +43,50 @@ #elif PLATFORM(QT) #include #include +#elif USE(CAIRO) +#include +#include +extern "C" +{ +cairo_surface_t * cairo_surface_map_to_image (cairo_surface_t *surface, + const cairo_rectangle_int_t *extents); + +void cairo_surface_unmap_image (cairo_surface_t *surface, + cairo_surface_t *image); + +} #endif namespace WebCore { + +#if USE(CAIRO) + struct CairoImageSurface { + CairoImageSurface() : m_surface( NULL ){} + ~CairoImageSurface() + { + clear(); + } + void clear() + { + if( m_surface ) { + cairo_surface_t* surface = (cairo_surface_t*)cairo_surface_get_user_data( m_surface, (const cairo_user_data_key_t *)0x80 ); + + if( surface ){ + printf( "unmap image!!\n" ); + cairo_surface_unmap_image( surface, m_surface ); + cairo_surface_destroy( surface ); + } + else + cairo_surface_destroy( m_surface ); + } + m_surface = NULL; + } + cairo_surface_t* m_surface; + unsigned* m_bytes; + }; +#endif + // FIXME: Do we want better encapsulation? typedef Vector ColorProfile; @@ -144,6 +184,8 @@ namespace WebCore { private: #if USE(CG) typedef RetainPtr NativeBackingStore; +//#elif USE(CAIRO) +// typedef CairoImageSurface NativeBackingStore; #else typedef Vector NativeBackingStore; #endif