Permalink
Browse files

Add some clone functions for DrawTargets

  • Loading branch information...
1 parent 9e604c7 commit f47c170c826a5634c894097d1778062c42e2896c @pcwalton pcwalton committed Aug 17, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 azure_hl.rs
View
@@ -164,6 +164,10 @@ class DrawTarget {
AzReleaseDrawTarget(self.azure_draw_target);
}
+ fn clone() -> DrawTarget {
+ return new_draw_target_from_azure_draw_target(self.azure_draw_target);
+ }
+
fn flush() {
AzDrawTargetFlush(self.azure_draw_target);
}
@@ -212,6 +216,11 @@ class DrawTarget {
}
}
+// Ugly workaround for the lack of explicit self.
+fn clone_mutable_draw_target(draw_target: &mut DrawTarget) -> DrawTarget {
+ return new_draw_target_from_azure_draw_target(draw_target.azure_draw_target);
+}
+
fn new_draw_target(cairo_surface: &ImageSurface) -> DrawTarget {
DrawTarget {
azure_draw_target: AzCreateDrawTargetForCairoSurface(cairo_surface.cairo_surface)

0 comments on commit f47c170

Please sign in to comment.