|
|
@ -171,6 +171,26 @@ Context2d::~Context2d() { |
|
|
|
cairo_destroy(_context); |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
* Save cairo / canvas state. |
|
|
|
*/ |
|
|
|
|
|
|
|
void |
|
|
|
Context2d::save() { |
|
|
|
cairo_save(_context); |
|
|
|
saveState(); |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
* Restore cairo / canvas state. |
|
|
|
*/ |
|
|
|
|
|
|
|
void |
|
|
|
Context2d::restore() { |
|
|
|
cairo_restore(_context); |
|
|
|
restoreState(); |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
* Save the current state. |
|
|
|
*/ |
|
|
@ -630,8 +650,7 @@ Handle<Value> |
|
|
|
Context2d::Save(const Arguments &args) { |
|
|
|
HandleScope scope; |
|
|
|
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); |
|
|
|
cairo_save(context->getContext()); |
|
|
|
context->saveState(); |
|
|
|
context->save(); |
|
|
|
return Undefined(); |
|
|
|
} |
|
|
|
|
|
|
@ -643,8 +662,7 @@ Handle<Value> |
|
|
|
Context2d::Restore(const Arguments &args) { |
|
|
|
HandleScope scope; |
|
|
|
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); |
|
|
|
cairo_restore(context->getContext()); |
|
|
|
context->restoreState(); |
|
|
|
context->restore(); |
|
|
|
return Undefined(); |
|
|
|
} |
|
|
|
|
|
|
|