Flutter Engine
 
Loading...
Searching...
No Matches
assertions_skia.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7namespace std {
8
9std::ostream& operator<<(std::ostream& os, const SkClipOp& o) {
10 switch (o) {
11 case SkClipOp::kDifference:
12 os << "ClipOpDifference";
13 break;
14 case SkClipOp::kIntersect:
15 os << "ClipOpIntersect";
16 break;
17 default:
18 os << "ClipOpUnknown" << static_cast<int>(o);
19 break;
20 }
21 return os;
22}
23
24std::ostream& operator<<(std::ostream& os, const SkMatrix& m) {
25 os << std::endl;
26 os << "Scale X: " << m[SkMatrix::kMScaleX] << ", ";
27 os << "Skew X: " << m[SkMatrix::kMSkewX] << ", ";
28 os << "Trans X: " << m[SkMatrix::kMTransX] << std::endl;
29 os << "Skew Y: " << m[SkMatrix::kMSkewY] << ", ";
30 os << "Scale Y: " << m[SkMatrix::kMScaleY] << ", ";
31 os << "Trans Y: " << m[SkMatrix::kMTransY] << std::endl;
32 os << "Persp X: " << m[SkMatrix::kMPersp0] << ", ";
33 os << "Persp Y: " << m[SkMatrix::kMPersp1] << ", ";
34 os << "Persp Z: " << m[SkMatrix::kMPersp2];
35 os << std::endl;
36 return os;
37}
38
39std::ostream& operator<<(std::ostream& os, const SkM44& m) {
40 os << m.rc(0, 0) << ", " << m.rc(0, 1) << ", " << m.rc(0, 2) << ", "
41 << m.rc(0, 3) << std::endl;
42 os << m.rc(1, 0) << ", " << m.rc(1, 1) << ", " << m.rc(1, 2) << ", "
43 << m.rc(1, 3) << std::endl;
44 os << m.rc(2, 0) << ", " << m.rc(2, 1) << ", " << m.rc(2, 2) << ", "
45 << m.rc(2, 3) << std::endl;
46 os << m.rc(3, 0) << ", " << m.rc(3, 1) << ", " << m.rc(3, 2) << ", "
47 << m.rc(3, 3);
48 return os;
49}
50
51std::ostream& operator<<(std::ostream& os, const SkVector3& v) {
52 return os << v.x() << ", " << v.y() << ", " << v.z();
53}
54
55std::ostream& operator<<(std::ostream& os, const SkIRect& r) {
56 return os << "LTRB: " << r.fLeft << ", " << r.fTop << ", " << r.fRight << ", "
57 << r.fBottom;
58}
59
60std::ostream& operator<<(std::ostream& os, const SkRect& r) {
61 return os << "LTRB: " << r.fLeft << ", " << r.fTop << ", " << r.fRight << ", "
62 << r.fBottom;
63}
64
65std::ostream& operator<<(std::ostream& os, const SkRRect& r) {
66 return os << "LTRB: " << r.rect().fLeft << ", " << r.rect().fTop << ", "
67 << r.rect().fRight << ", " << r.rect().fBottom;
68}
69
70std::ostream& operator<<(std::ostream& os, const SkPath& r) {
71 return os << "Valid: " << r.isValid()
72 << ", FillType: " << static_cast<int>(r.getFillType())
73 << ", Bounds: " << r.getBounds();
74}
75
76std::ostream& operator<<(std::ostream& os, const SkPoint& r) {
77 return os << "XY: " << r.fX << ", " << r.fY;
78}
79
80std::ostream& operator<<(std::ostream& os, const SkISize& size) {
81 return os << size.width() << ", " << size.height();
82}
83
84std::ostream& operator<<(std::ostream& os, const SkColor4f& r) {
85 return os << r.fR << ", " << r.fG << ", " << r.fB << ", " << r.fA;
86}
87
88std::ostream& operator<<(std::ostream& os, const SkPaint& r) {
89 return os << "Color: " << r.getColor4f() << ", Style: " << r.getStyle()
90 << ", AA: " << r.isAntiAlias() << ", Shader: " << r.getShader();
91}
92
93std::ostream& operator<<(std::ostream& os, const SkSamplingOptions& s) {
94 if (s.useCubic) {
95 return os << "CubicResampler: " << s.cubic.B << ", " << s.cubic.C;
96 } else {
97 return os << "Filter: " << static_cast<int>(s.filter)
98 << ", Mipmap: " << static_cast<int>(s.mipmap);
99 }
100}
101
102} // namespace std
Definition ref_ptr.h:261
std::ostream & operator<<(std::ostream &out, const impeller::Arc &a)
Definition arc.h:141