Sentry helper class for functions with multiple return points that need to back up the current path of a context and have it automatically restored before they return. More...
#include <gfxContext.h>
Collaboration diagram for gfxContextPathAutoSaveRestore:Public Member Functions | |
| gfxContextPathAutoSaveRestore () | |
| gfxContextPathAutoSaveRestore (gfxContext *aContext, PRBool aSave=1) | |
| ~gfxContextPathAutoSaveRestore () | |
| void | SetContext (gfxContext *aContext, PRBool aSave=1) |
| void | Save () |
| If a path is already saved, does nothing. | |
| void | Restore () |
| If no path is saved, does nothing. | |
Sentry helper class for functions with multiple return points that need to back up the current path of a context and have it automatically restored before they return.
This class assumes that the transformation matrix will be the same when Save and Restore are called. The calling function must ensure that this is the case or the path will be copied incorrectly.
| gfxContextPathAutoSaveRestore::gfxContextPathAutoSaveRestore | ( | ) | [inline] |
| gfxContextPathAutoSaveRestore::gfxContextPathAutoSaveRestore | ( | gfxContext * | aContext, | |
| PRBool | aSave = 1 | |||
| ) | [inline] |
| gfxContextPathAutoSaveRestore::~gfxContextPathAutoSaveRestore | ( | ) | [inline] |
| void gfxContextPathAutoSaveRestore::Restore | ( | ) | [inline] |
If no path is saved, does nothing.
Else replaces the context's path with a copy of the saved one, and clears the saved path.
| void gfxContextPathAutoSaveRestore::Save | ( | ) | [inline] |
If a path is already saved, does nothing.
Else copies the current path so that it may be restored.
| void gfxContextPathAutoSaveRestore::SetContext | ( | gfxContext * | aContext, | |
| PRBool | aSave = 1 | |||
| ) | [inline] |
1.7.1