]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/graphcmn.cpp
Ensure that the default wxWebView backends are registered.
[wxWidgets.git] / src / common / graphcmn.cpp
index 34dae699a56d245d070d5df0906ca46225871eb0..9a75c2bf7167ca202accd9ace860a9c5a5915e95 100644 (file)
@@ -524,6 +524,11 @@ void wxGraphicsGradientStops::Add(const wxGraphicsGradientStop& stop)
     }
 }
 
+void * wxGraphicsBitmap::GetNativeBitmap() const
+{
+    return GetBitmapData()->GetNativeBitmap();
+}
+
 //-----------------------------------------------------------------------------
 // wxGraphicsContext Convenience Methods
 //-----------------------------------------------------------------------------
@@ -665,9 +670,7 @@ wxGraphicsContext::DoDrawFilledText(const wxString &str,
     // to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape
     SetPen( wxNullGraphicsPen );
 
-    wxGraphicsPath path = CreatePath();
-    path.AddRectangle( x , y, width, height );
-    FillPath( path );
+    DrawRectangle(x , y, width, height);
 
     DrawText( str, x ,y);
     SetBrush( formerBrush );
@@ -839,17 +842,32 @@ wxGraphicsContext::CreateRadialGradientBrush(
                           );
 }
 
-// sets the font
 wxGraphicsFont wxGraphicsContext::CreateFont( const wxFont &font , const wxColour &col ) const
 {
     return GetRenderer()->CreateFont(font,col);
 }
 
+wxGraphicsFont
+wxGraphicsContext::CreateFont(double size,
+                              const wxString& facename,
+                              int flags,
+                              const wxColour& col) const
+{
+    return GetRenderer()->CreateFont(size, facename, flags, col);
+}
+
 wxGraphicsBitmap wxGraphicsContext::CreateBitmap( const wxBitmap& bmp ) const
 {
     return GetRenderer()->CreateBitmap(bmp);
 }
 
+#if wxUSE_IMAGE
+wxGraphicsBitmap wxGraphicsContext::CreateBitmapFromImage(const wxImage& image) const
+{
+    return GetRenderer()->CreateBitmapFromImage(image);
+}
+#endif // wxUSE_IMAGE
+
 wxGraphicsBitmap wxGraphicsContext::CreateSubBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h   ) const
 {
     return GetRenderer()->CreateSubBitmap(bmp,x,y,w,h);
@@ -896,6 +914,13 @@ wxGraphicsContext* wxGraphicsContext::Create( wxWindow* window )
     return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(window);
 }
 
+#if wxUSE_IMAGE
+/* static */ wxGraphicsContext* wxGraphicsContext::Create(wxImage& image)
+{
+    return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromImage(image);
+}
+#endif // wxUSE_IMAGE
+
 wxGraphicsContext* wxGraphicsContext::Create()
 {
     return wxGraphicsRenderer::GetDefaultRenderer()->CreateMeasuringContext();