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

Side by Side Diff: third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp

Issue 2874203003: Implement serialization/deserialization of geometry interfaces (Closed)
Patch Set: x Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/geometry/DOMMatrixReadOnly.h" 5 #include "core/geometry/DOMMatrixReadOnly.h"
6 6
7 #include "bindings/core/v8/V8ObjectBuilder.h" 7 #include "bindings/core/v8/V8ObjectBuilder.h"
8 #include "core/css/CSSIdentifierValue.h" 8 #include "core/css/CSSIdentifierValue.h"
9 #include "core/css/CSSToLengthConversionData.h" 9 #include "core/css/CSSToLengthConversionData.h"
10 #include "core/css/CSSValueList.h" 10 #include "core/css/CSSValueList.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 float64_array.View()->length()); 148 float64_array.View()->length());
149 } 149 }
150 150
151 DOMMatrixReadOnly* DOMMatrixReadOnly::fromMatrix( 151 DOMMatrixReadOnly* DOMMatrixReadOnly::fromMatrix(
152 DOMMatrixInit& other, 152 DOMMatrixInit& other,
153 ExceptionState& exception_state) { 153 ExceptionState& exception_state) {
154 if (!ValidateAndFixup(other, exception_state)) { 154 if (!ValidateAndFixup(other, exception_state)) {
155 DCHECK(exception_state.HadException()); 155 DCHECK(exception_state.HadException());
156 return nullptr; 156 return nullptr;
157 } 157 }
158 return fromMatrixForSerialization(other);
159 }
158 160
161 DOMMatrixReadOnly* DOMMatrixReadOnly::fromMatrixForSerialization(
162 DOMMatrixInit& other) {
159 if (other.is2D()) { 163 if (other.is2D()) {
160 double args[] = {other.m11(), other.m12(), other.m21(), 164 double args[] = {other.a(), other.b(), other.c(),
161 other.m22(), other.m41(), other.m42()}; 165 other.d(), other.e(), other.f()};
162 return new DOMMatrixReadOnly(args, 6); 166 return new DOMMatrixReadOnly(args, 6);
163 } 167 }
164 168
165 double args[] = {other.m11(), other.m12(), other.m13(), other.m14(), 169 double args[] = {other.m11(), other.m12(), other.m13(), other.m14(),
166 other.m21(), other.m22(), other.m23(), other.m24(), 170 other.m21(), other.m22(), other.m23(), other.m24(),
167 other.m31(), other.m32(), other.m33(), other.m34(), 171 other.m31(), other.m32(), other.m33(), other.m34(),
168 other.m41(), other.m42(), other.m43(), other.m44()}; 172 other.m41(), other.m42(), other.m43(), other.m44()};
169 return new DOMMatrixReadOnly(args, 16); 173 return new DOMMatrixReadOnly(args, 16);
170 } 174 }
171 175
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 403
400 matrix_->MakeIdentity(); 404 matrix_->MakeIdentity();
401 operations.Apply(FloatSize(0, 0), *matrix_); 405 operations.Apply(FloatSize(0, 0), *matrix_);
402 406
403 is2d_ = !operations.Has3DOperation(); 407 is2d_ = !operations.Has3DOperation();
404 408
405 return; 409 return;
406 } 410 }
407 411
408 } // namespace blink 412 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698