| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPDFDeviceFlattener.h" | 8 #include "SkPDFDeviceFlattener.h" |
| 9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 const SkPoint& offset, const SkPaint& pai
nt) { | 127 const SkPoint& offset, const SkPaint& pai
nt) { |
| 128 if (mustPathText(d, paint)) { | 128 if (mustPathText(d, paint)) { |
| 129 d.drawPosText_asPaths((const char*)text, len, pos, scalarsPerPos, offset
, paint); | 129 d.drawPosText_asPaths((const char*)text, len, pos, scalarsPerPos, offset
, paint); |
| 130 return; | 130 return; |
| 131 } | 131 } |
| 132 INHERITED::drawPosText(d, text, len, pos, scalarsPerPos, offset, paint); | 132 INHERITED::drawPosText(d, text, len, pos, scalarsPerPos, offset, paint); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void SkPDFDeviceFlattener::drawTextOnPath(const SkDraw& d, const void* text, siz
e_t len, | 135 void SkPDFDeviceFlattener::drawTextOnPath(const SkDraw& d, const void* text, siz
e_t len, |
| 136 const SkPath& path, const SkMatrix* ma
trix, | 136 const SkPath& path, const SkMatrix* ma
trix, |
| 137 SK_SUPPORT_LEGACY_DRAWTEXTONPATH_PARAM |
| 137 const SkPaint& paint) { | 138 const SkPaint& paint) { |
| 139 SK_SUPPORT_LEGACY_DRAWTEXTONPATH_DEFAULT_METHOD |
| 138 if (mustPathText(d, paint) || (matrix && matrix->hasPerspective())) { | 140 if (mustPathText(d, paint) || (matrix && matrix->hasPerspective())) { |
| 139 d.drawTextOnPath((const char*)text, len, path, matrix, paint); | 141 d.drawTextOnPath((const char*)text, len, path, matrix, method, paint); |
| 140 return; | 142 return; |
| 141 } | 143 } |
| 142 INHERITED::drawTextOnPath(d, text, len, path, matrix, paint); | 144 INHERITED::drawTextOnPath(d, text, len, path, matrix, |
| 145 SK_SUPPORT_LEGACY_DRAWTEXTONPATH_ARG paint); |
| 143 } | 146 } |
| 144 | 147 |
| 145 bool SkPDFDeviceFlattener::mustFlatten(const SkDraw& d) const { | 148 bool SkPDFDeviceFlattener::mustFlatten(const SkDraw& d) const { |
| 146 // TODO(edisonn): testability, add flag to force return true. | 149 // TODO(edisonn): testability, add flag to force return true. |
| 147 return d.fMatrix->hasPerspective(); | 150 return d.fMatrix->hasPerspective(); |
| 148 } | 151 } |
| 149 | 152 |
| 150 bool SkPDFDeviceFlattener::mustPathText(const SkDraw& d, const SkPaint&) { | 153 bool SkPDFDeviceFlattener::mustPathText(const SkDraw& d, const SkPaint&) { |
| 151 // TODO(edisonn): testability, add flag to force return true. | 154 // TODO(edisonn): testability, add flag to force return true. |
| 152 // TODO(edisonn): TBD: How to flatten MaskFilter. | 155 // TODO(edisonn): TBD: How to flatten MaskFilter. |
| 153 return d.fMatrix->hasPerspective(); | 156 return d.fMatrix->hasPerspective(); |
| 154 } | 157 } |
| OLD | NEW |