Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1161)

Unified Diff: Source/platform/graphics/GraphicsContextState.h

Issue 303613002: Avoid redundant initialization of GraphicsContextState. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: pass reference to copy functions Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/GraphicsContextState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContextState.h
diff --git a/Source/platform/graphics/GraphicsContextState.h b/Source/platform/graphics/GraphicsContextState.h
index ee1c625da3c9d9862baad526443892fcdd6afa7a..a714c47f43f45465f0c78dd214642979a3b04ad5 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()
{
return adoptPtr(new GraphicsContextState());
}
- void copy(GraphicsContextState*);
+ static PassOwnPtr<GraphicsContextState> createAndCopy(const GraphicsContextState& other)
+ {
+ return adoptPtr(new GraphicsContextState(other));
+ }
+
+ void copy(const GraphicsContextState&);
// 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&);
f(malita) 2014/05/28 12:59:19 Since we're dropping WTF_MAKE_NONCOPYABLE but only
Dominik Grewe 2014/05/28 14:52:10 Done.
// Helper function for applying the state's alpha value to the given input
// color to produce a new output color.
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/GraphicsContextState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698