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

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

Issue 2874203003: Implement serialization/deserialization of geometry interfaces (Closed)
Patch Set: x Created 3 years, 6 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/DOMMatrix.h" 5 #include "core/geometry/DOMMatrix.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context, 9 DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context,
10 ExceptionState& exception_state) { 10 ExceptionState& exception_state) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ExceptionState& exception_state) { 45 ExceptionState& exception_state) {
46 return new DOMMatrix(other->Matrix(), other->is2D()); 46 return new DOMMatrix(other->Matrix(), other->is2D());
47 } 47 }
48 48
49 DOMMatrix* DOMMatrix::Create(const SkMatrix44& matrix, 49 DOMMatrix* DOMMatrix::Create(const SkMatrix44& matrix,
50 ExceptionState& exception_state) { 50 ExceptionState& exception_state) {
51 TransformationMatrix transformation_matrix(matrix); 51 TransformationMatrix transformation_matrix(matrix);
52 return new DOMMatrix(transformation_matrix, transformation_matrix.IsAffine()); 52 return new DOMMatrix(transformation_matrix, transformation_matrix.IsAffine());
53 } 53 }
54 54
55 DOMMatrix* DOMMatrix::CreateForSerialization(double sequence[], int size) {
56 return new DOMMatrix(sequence, size);
57 }
58
55 DOMMatrix* DOMMatrix::fromFloat32Array(NotShared<DOMFloat32Array> float32_array, 59 DOMMatrix* DOMMatrix::fromFloat32Array(NotShared<DOMFloat32Array> float32_array,
56 ExceptionState& exception_state) { 60 ExceptionState& exception_state) {
57 if (float32_array.View()->length() != 6 && 61 if (float32_array.View()->length() != 6 &&
58 float32_array.View()->length() != 16) { 62 float32_array.View()->length() != 16) {
59 exception_state.ThrowTypeError( 63 exception_state.ThrowTypeError(
60 "The sequence must contain 6 elements for a 2D matrix or 16 elements " 64 "The sequence must contain 6 elements for a 2D matrix or 16 elements "
61 "for a 3D matrix."); 65 "for a 3D matrix.");
62 return nullptr; 66 return nullptr;
63 } 67 }
64 return new DOMMatrix(float32_array.View()->Data(), 68 return new DOMMatrix(float32_array.View()->Data(),
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return this; 279 return this;
276 } 280 }
277 281
278 DOMMatrix* DOMMatrix::setMatrixValue(const String& input_string, 282 DOMMatrix* DOMMatrix::setMatrixValue(const String& input_string,
279 ExceptionState& exception_state) { 283 ExceptionState& exception_state) {
280 SetMatrixValueFromString(input_string, exception_state); 284 SetMatrixValueFromString(input_string, exception_state);
281 return this; 285 return this;
282 } 286 }
283 287
284 } // namespace blink 288 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/geometry/DOMMatrix.h ('k') | third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698