OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPDFUtils_DEFINED | 10 #ifndef SkPDFUtils_DEFINED |
(...skipping 17 matching lines...) Expand all Loading... |
28 #define NOT_IMPLEMENTED(condition, assert) \ | 28 #define NOT_IMPLEMENTED(condition, assert) \ |
29 do { \ | 29 do { \ |
30 if ((bool)(condition)) { \ | 30 if ((bool)(condition)) { \ |
31 PRINT_NOT_IMPL("NOT_IMPLEMENTED: " #condition "\n"); \ | 31 PRINT_NOT_IMPL("NOT_IMPLEMENTED: " #condition "\n"); \ |
32 SkDEBUGCODE(SkASSERT(!assert);) \ | 32 SkDEBUGCODE(SkASSERT(!assert);) \ |
33 } \ | 33 } \ |
34 } while (0) | 34 } while (0) |
35 | 35 |
36 class SkPDFUtils { | 36 class SkPDFUtils { |
37 public: | 37 public: |
38 static SkPDFArray* RectToArray(const SkRect& rect); | 38 static sk_sp<SkPDFArray> RectToArray(const SkRect& rect); |
39 static SkPDFArray* MatrixToArray(const SkMatrix& matrix); | 39 static sk_sp<SkPDFArray> MatrixToArray(const SkMatrix& matrix); |
40 static void AppendTransform(const SkMatrix& matrix, SkWStream* content); | 40 static void AppendTransform(const SkMatrix& matrix, SkWStream* content); |
41 | 41 |
42 static void MoveTo(SkScalar x, SkScalar y, SkWStream* content); | 42 static void MoveTo(SkScalar x, SkScalar y, SkWStream* content); |
43 static void AppendLine(SkScalar x, SkScalar y, SkWStream* content); | 43 static void AppendLine(SkScalar x, SkScalar y, SkWStream* content); |
44 static void AppendCubic(SkScalar ctl1X, SkScalar ctl1Y, | 44 static void AppendCubic(SkScalar ctl1X, SkScalar ctl1Y, |
45 SkScalar ctl2X, SkScalar ctl2Y, | 45 SkScalar ctl2X, SkScalar ctl2Y, |
46 SkScalar dstX, SkScalar dstY, SkWStream* content); | 46 SkScalar dstX, SkScalar dstY, SkWStream* content); |
47 static void AppendRectangle(const SkRect& rect, SkWStream* content); | 47 static void AppendRectangle(const SkRect& rect, SkWStream* content); |
48 static void EmitPath(const SkPath& path, SkPaint::Style paintStyle, | 48 static void EmitPath(const SkPath& path, SkPaint::Style paintStyle, |
49 bool doConsumeDegerates, SkWStream* content); | 49 bool doConsumeDegerates, SkWStream* content); |
(...skipping 14 matching lines...) Expand all Loading... |
64 // abs(FLT_MIN_10_EXP) = number of zeros in FLT_MIN | 64 // abs(FLT_MIN_10_EXP) = number of zeros in FLT_MIN |
65 static const size_t kMaximumFloatDecimalLength = 3 + 9 - FLT_MIN_10_EXP; | 65 static const size_t kMaximumFloatDecimalLength = 3 + 9 - FLT_MIN_10_EXP; |
66 // FloatToDecimal is exposed for unit tests. | 66 // FloatToDecimal is exposed for unit tests. |
67 static size_t FloatToDecimal(float value, | 67 static size_t FloatToDecimal(float value, |
68 char output[kMaximumFloatDecimalLength]); | 68 char output[kMaximumFloatDecimalLength]); |
69 static void AppendScalar(SkScalar value, SkWStream* stream); | 69 static void AppendScalar(SkScalar value, SkWStream* stream); |
70 static SkString FormatString(const char* input, size_t len); | 70 static SkString FormatString(const char* input, size_t len); |
71 }; | 71 }; |
72 | 72 |
73 #endif | 73 #endif |
OLD | NEW |