Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp |
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
index bcc45217d6d560b536ee08db7109573f556127f1..e4c264eef0d06c5d7d6020b420c418929d66493b 100644 |
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
@@ -47,6 +47,7 @@ |
#include "core/html/HTMLVideoElement.h" |
#include "core/html/ImageData.h" |
#include "core/html/TextMetrics.h" |
+#include "core/html/canvas/Canvas2DContextAttributes.h" |
#include "core/html/canvas/CanvasGradient.h" |
#include "core/html/canvas/CanvasPattern.h" |
#include "core/html/canvas/CanvasStyle.h" |
@@ -117,11 +118,12 @@ private: |
CanvasRenderingContext2D* m_canvasContext; |
}; |
-CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, bool usesCSSCompatibilityParseMode) |
+CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode) |
: CanvasRenderingContext(canvas) |
, m_stateStack(1) |
, m_unrealizedSaveCount(0) |
, m_usesCSSCompatibilityParseMode(usesCSSCompatibilityParseMode) |
+ , m_hasAlpha(!attrs || attrs->alpha()) |
{ |
ScriptWrappable::init(this); |
} |
@@ -2250,4 +2252,11 @@ void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled) |
c->setImageInterpolationQuality(enabled ? DefaultInterpolationQuality : InterpolationNone); |
} |
+PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttributes() const |
+{ |
+ RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::create(); |
+ attributes->setAlpha(m_hasAlpha); |
+ return attributes.release(); |
+} |
+ |
} // namespace WebCore |