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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 795833004: Use dictionaries for context creation attributes. Eliminate custom bindings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years 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/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index c98b4a4759a096245ce17b716a1df0a8aa002901..bcafe93f23c1f4948c7f8cb48817fd395a44a8f5 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -90,14 +90,13 @@ static bool contextLostRestoredEventsEnabled()
return RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled();
}
-CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, const Canvas2DContextAttributes* attrs, Document& document)
+CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document& document)
: CanvasRenderingContext(canvas)
, m_usesCSSCompatibilityParseMode(document.inQuirksMode())
, m_clipAntialiasing(NotAntiAliased)
- , m_hasAlpha(!attrs || attrs->alpha())
+ , m_hasAlpha(attrs.alpha())
, m_isContextLost(false)
, m_contextRestorable(true)
- , m_storageMode(!attrs ? PersistentStorage : attrs->parsedStorage())
, m_tryRestoreContextAttemptCount(0)
, m_dispatchContextLostEventTimer(this, &CanvasRenderingContext2D::dispatchContextLostEvent)
, m_dispatchContextRestoredEventTimer(this, &CanvasRenderingContext2D::dispatchContextRestoredEvent)
@@ -2227,11 +2226,9 @@ void CanvasRenderingContext2D::setImageSmoothingEnabled(bool enabled)
c->setImageInterpolationQuality(enabled ? CanvasDefaultInterpolationQuality : InterpolationNone);
}
-PassRefPtrWillBeRawPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttributes() const
+void CanvasRenderingContext2D::getContextAttributes(Canvas2DContextAttributes& attrs) const
{
- RefPtrWillBeRawPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::create();
- attributes->setAlpha(m_hasAlpha);
- return attributes.release();
+ attrs.setAlpha(m_hasAlpha);
}
void CanvasRenderingContext2D::drawFocusIfNeeded(Element* element)
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/core/html/canvas/ContextAttributeHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698