summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SharedGraphics/Painter.cpp11
-rw-r--r--SharedGraphics/Painter.h12
2 files changed, 13 insertions, 10 deletions
diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp
index b6f9777320..0b4c0beb45 100644
--- a/SharedGraphics/Painter.cpp
+++ b/SharedGraphics/Painter.cpp
@@ -565,3 +565,14 @@ void Painter::clear_clip_rect()
{
state().clip_rect = m_clip_origin;
}
+
+PainterStateSaver::PainterStateSaver(Painter& painter)
+ : m_painter(painter)
+{
+ m_painter.save();
+}
+
+PainterStateSaver::~PainterStateSaver()
+{
+ m_painter.restore();
+}
diff --git a/SharedGraphics/Painter.h b/SharedGraphics/Painter.h
index 4e8fb2d386..275d84463f 100644
--- a/SharedGraphics/Painter.h
+++ b/SharedGraphics/Painter.h
@@ -80,16 +80,8 @@ protected:
class PainterStateSaver {
public:
- PainterStateSaver(Painter& painter)
- : m_painter(painter)
- {
- m_painter.save();
- }
-
- ~PainterStateSaver()
- {
- m_painter.restore();
- }
+ explicit PainterStateSaver(Painter&);
+ ~PainterStateSaver();
private:
Painter& m_painter;