{
// R = Result, S = Source, D = Destination, premultiplied with alpha
// Ra, Sa, Da their alpha components
-
+
// classic Porter-Duff compositions
// http://keithp.com/~keithp/porterduff/p253-porter.pdf
-
+
wxCOMPOSITION_CLEAR, /* R = 0 */
wxCOMPOSITION_SOURCE, /* R = S */
wxCOMPOSITION_OVER, /* R = S + D*(1 - Sa) */
wxCOMPOSITION_DEST_OUT, /* R = D*(1 - Sa) */
wxCOMPOSITION_DEST_ATOP, /* R = S*(1 - Da) + D*Sa */
wxCOMPOSITION_XOR, /* R = S*(1 - Da) + D*(1 - Sa) */
-
+
// mathematical compositions
wxCOMPOSITION_ADD, /* R = S + D */
};
// returns the current shape antialiasing mode
virtual wxAntialiasMode GetAntialiasMode() const { return m_antialias; }
-
+
// sets the antialiasing mode, returns true if it supported
virtual bool SetAntialiasMode(wxAntialiasMode antialias) = 0;
// returns the current compositing operator
virtual wxCompositionMode GetCompositionMode() const { return m_composition; }
-
+
// sets the compositing operator, returns true if it supported
virtual bool SetCompositionMode(wxCompositionMode op) = 0;
// all rendering is done into a fully transparent temporary context
virtual void BeginLayer(wxDouble opacity) = 0;
- // composites back the drawings into the context with the opacity given at
+ // composites back the drawings into the context with the opacity given at
// the BeginLayer call
virtual void EndLayer() = 0;
virtual void GetTextExtent( const wxString &text, wxDouble *width, wxDouble *height,
- wxDouble *descent, wxDouble *externalLeading ) const = 0;
+ wxDouble *descent = NULL, wxDouble *externalLeading = NULL ) const = 0;
virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const = 0;
static wxGraphicsRenderer* GetDefaultRenderer();
+ static wxGraphicsRenderer* GetCairoRenderer();
// Context
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0;
// create a native bitmap representation
virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0;
+
+ // create a graphics bitmap from a native bitmap
+ virtual wxGraphicsBitmap CreateBitmapFromNativeBitmap( void* bitmap ) = 0;
// create a subimage from a native image representation
virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;