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

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: Rebased to ToT; test cleanup 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
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/core/html/canvas/Canvas2DContextAttributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/Canvas2DContextAttributes.h
diff --git a/Source/core/platform/graphics/opentype/OpenTypeSanitizer.h b/Source/core/html/canvas/Canvas2DContextAttributes.h
similarity index 68%
copy from Source/core/platform/graphics/opentype/OpenTypeSanitizer.h
copy to Source/core/html/canvas/Canvas2DContextAttributes.h
index cca70cfe78c04510e12f553ca9210eca617662a8..dbf15864a60d216576bf37656f0861f5596addee 100644
--- a/Source/core/platform/graphics/opentype/OpenTypeSanitizer.h
+++ b/Source/core/html/canvas/Canvas2DContextAttributes.h
@@ -1,19 +1,15 @@
/*
- * Copyright (C) 2009 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
* met:
- *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -28,28 +24,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef OpenTypeSanitizer_h
-#define OpenTypeSanitizer_h
+#ifndef Canvas2DContextAttributes_h
+#define Canvas2DContextAttributes_h
-#include <wtf/Forward.h>
+#include "CanvasContextAttributes.h"
+#include <wtf/PassRefPtr.h>
namespace WebCore {
-class SharedBuffer;
-
-class OpenTypeSanitizer {
+class Canvas2DContextAttributes : public CanvasContextAttributes {
public:
- explicit OpenTypeSanitizer(SharedBuffer* buffer)
- : m_buffer(buffer)
- {
- }
+ virtual ~Canvas2DContextAttributes();
+
+ // 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);
- PassRefPtr<SharedBuffer> sanitize();
+protected:
+ Canvas2DContextAttributes();
-private:
- SharedBuffer* const m_buffer;
+ bool m_alpha;
};
} // namespace WebCore
-#endif // OpenTypeSanitizer_h
+#endif // Canvas2DContextAttributes_h
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/core/html/canvas/Canvas2DContextAttributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698