Chromium Code Reviews| Index: Source/platform/graphics/GraphicsContextState.h |
| diff --git a/Source/platform/graphics/GraphicsContextState.h b/Source/platform/graphics/GraphicsContextState.h |
| index ee1c625da3c9d9862baad526443892fcdd6afa7a..a70ab2ed7c190109d72106ca55077985eac2721c 100644 |
| --- a/Source/platform/graphics/GraphicsContextState.h |
| +++ b/Source/platform/graphics/GraphicsContextState.h |
| @@ -46,14 +46,18 @@ namespace WebCore { |
| // Encapsulates the state information we store for each pushed graphics state. |
| // Only GraphicsContext can use this class. |
| class PLATFORM_EXPORT GraphicsContextState FINAL { |
| - WTF_MAKE_NONCOPYABLE(GraphicsContextState); |
| public: |
| static PassOwnPtr<GraphicsContextState> create() |
|
f(malita)
2014/05/27 18:16:44
Let's update this instead: create(const GraphicsCo
|
| { |
| return adoptPtr(new GraphicsContextState()); |
| } |
| - void copy(GraphicsContextState*); |
| + static PassOwnPtr<GraphicsContextState> createAndCopy(const GraphicsContextState* other) |
|
f(malita)
2014/05/27 18:16:44
realizePaintSave() is the only user of create(), n
Dominik Grewe
2014/05/27 19:59:22
The GraphicsContext constructor also calls create,
|
| + { |
| + return adoptPtr(new GraphicsContextState(*other)); |
| + } |
| + |
| + void copy(const GraphicsContextState*); |
|
f(malita)
2014/05/27 18:16:44
Let's also update this to a const reference argume
Dominik Grewe
2014/05/27 19:59:22
Will do.
|
| // SkPaint objects that reflect the current state. If the length of the |
| // path to be stroked is known, pass it in for correct dash or dot placement. |
| @@ -142,6 +146,7 @@ public: |
| private: |
| GraphicsContextState(); |
| + explicit GraphicsContextState(const GraphicsContextState&); |
| // Helper function for applying the state's alpha value to the given input |
| // color to produce a new output color. |