| 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 #include "SkShader.h" |
| 10 | 11 |
| 11 static SkISize SkSizeToISize(const SkSize& size) { | 12 static SkISize SkSizeToISize(const SkSize& size) { |
| 12 return SkISize::Make(SkScalarRoundToInt(size.width()), SkScalarRoundToInt(si
ze.height())); | 13 return SkISize::Make(SkScalarRoundToInt(size.width()), SkScalarRoundToInt(si
ze.height())); |
| 13 } | 14 } |
| 14 | 15 |
| 15 SkPDFDeviceFlattener::SkPDFDeviceFlattener(const SkSize& pageSize, const SkRect*
trimBox) | 16 SkPDFDeviceFlattener::SkPDFDeviceFlattener(const SkSize& pageSize, const SkRect*
trimBox) |
| 16 : SkPDFDevice(SkSizeToISize(pageSize), | 17 : SkPDFDevice(SkSizeToISize(pageSize), |
| 17 SkSizeToISize(pageSize), | 18 SkSizeToISize(pageSize), |
| 18 SkMatrix::I()) { | 19 SkMatrix::I()) { |
| 19 // TODO(edisonn): store the trimbox on emit. | 20 // TODO(edisonn): store the trimbox on emit. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 bool SkPDFDeviceFlattener::mustFlatten(const SkDraw& d) const { | 146 bool SkPDFDeviceFlattener::mustFlatten(const SkDraw& d) const { |
| 146 // TODO(edisonn): testability, add flag to force return true. | 147 // TODO(edisonn): testability, add flag to force return true. |
| 147 return d.fMatrix->hasPerspective(); | 148 return d.fMatrix->hasPerspective(); |
| 148 } | 149 } |
| 149 | 150 |
| 150 bool SkPDFDeviceFlattener::mustPathText(const SkDraw& d, const SkPaint&) { | 151 bool SkPDFDeviceFlattener::mustPathText(const SkDraw& d, const SkPaint&) { |
| 151 // TODO(edisonn): testability, add flag to force return true. | 152 // TODO(edisonn): testability, add flag to force return true. |
| 152 // TODO(edisonn): TBD: How to flatten MaskFilter. | 153 // TODO(edisonn): TBD: How to flatten MaskFilter. |
| 153 return d.fMatrix->hasPerspective(); | 154 return d.fMatrix->hasPerspective(); |
| 154 } | 155 } |
| OLD | NEW |