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

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

Issue 24233004: Support currentTransform in 2D Canvas. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove custom binding based on ch.dumez's work Created 7 years, 3 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/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 4d7b8c43d0a40af0aecb4b810b8fecb7bba8f5b4..032730641df98c9d8a13ccd4df0c237250a3731a 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -596,6 +596,16 @@ void CanvasRenderingContext2D::setGlobalCompositeOperation(const String& operati
c->setCompositeOperation(op, blendMode);
}
+void CanvasRenderingContext2D::setCurrentTransform(SVGPropertyTearOff<SVGMatrix>* currentTransform, ExceptionState& es)
+{
+ if (!currentTransform) {
+ es.throwDOMException(TypeError);
+ return;
+ }
+ const SVGMatrix& matrix = currentTransform->propertyReference();
+ setTransform(matrix.a(), matrix.b(), matrix.c(), matrix.d(), matrix.e(), matrix.f());
+}
+
void CanvasRenderingContext2D::scale(float sx, float sy)
{
GraphicsContext* c = drawingContext();
@@ -698,12 +708,12 @@ void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float
realizeSaves();
+ modifiableState().m_transform = newTransform;
dshwang 2013/09/20 11:38:52 when setting non-invertible matrix, currentTransfo
if (!newTransform.isInvertible()) {
modifiableState().m_invertibleCTM = false;
return;
}
- modifiableState().m_transform = newTransform;
c->concatCTM(transform);
m_path.transform(transform.inverse());
}
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/core/html/canvas/CanvasRenderingContext2D.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698