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

Unified Diff: Source/core/html/canvas/Canvas2DContextAttributes.h

Issue 14298018: This CL implements the first draft of Canvas 2D Context Attributes, aka getContext('2d', { alpha: f… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixes from review comments; remove WebPreferences.h changes; fix comment. Created 7 years, 8 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
Index: Source/core/html/canvas/Canvas2DContextAttributes.h
diff --git a/Source/core/html/canvas/CanvasContextAttributes.cpp b/Source/core/html/canvas/Canvas2DContextAttributes.h
similarity index 69%
copy from Source/core/html/canvas/CanvasContextAttributes.cpp
copy to Source/core/html/canvas/Canvas2DContextAttributes.h
index d3d0398afd60b5807f84fa9367a15de17ef3b7da..dbf15864a60d216576bf37656f0861f5596addee 100644
--- a/Source/core/html/canvas/CanvasContextAttributes.cpp
+++ b/Source/core/html/canvas/Canvas2DContextAttributes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Google Inc. All rights reserved.
+ * Copyright (c) 2013, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -24,18 +24,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
+#ifndef Canvas2DContextAttributes_h
+#define Canvas2DContextAttributes_h
#include "CanvasContextAttributes.h"
+#include <wtf/PassRefPtr.h>
namespace WebCore {
-CanvasContextAttributes::CanvasContextAttributes()
-{
-}
+class Canvas2DContextAttributes : public CanvasContextAttributes {
+public:
+ virtual ~Canvas2DContextAttributes();
-CanvasContextAttributes::~CanvasContextAttributes()
-{
-}
+ // Create a new attributes object
+ static PassRefPtr<Canvas2DContextAttributes> create();
+
+ // Whether or not the drawing buffer has an alpha channel; default=true
+ bool alpha() const;
+ void setAlpha(bool);
+
+protected:
+ Canvas2DContextAttributes();
+
+ bool m_alpha;
+};
} // namespace WebCore
+
+#endif // Canvas2DContextAttributes_h

Powered by Google App Engine
This is Rietveld 408576698