| 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 "SkPdfGraphicsState.h" | 8 #include "SkPdfGraphicsState.h" |
| 9 | 9 |
| 10 #include "SkDashPathEffect.h" | 10 #include "SkDashPathEffect.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 fNonStroking.applyGraphicsState(paint); | 26 fNonStroking.applyGraphicsState(paint); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // TODO(edisonn): Perf, we should load this option from pdfContext->options, | 29 // TODO(edisonn): Perf, we should load this option from pdfContext->options, |
| 30 // or pdfContext->addPaintOptions(&paint); | 30 // or pdfContext->addPaintOptions(&paint); |
| 31 paint->setAntiAlias(true); | 31 paint->setAntiAlias(true); |
| 32 | 32 |
| 33 // TODO(edisonn): miter, ... | 33 // TODO(edisonn): miter, ... |
| 34 if (stroking) { | 34 if (stroking) { |
| 35 paint->setStrokeWidth(SkDoubleToScalar(fLineWidth)); | 35 paint->setStrokeWidth(SkDoubleToScalar(fLineWidth)); |
| 36 // TODO(edisonn): perf, avoid allocs allocs | 36 // TODO(edisonn): perf, avoid allocs of the intervals |
| 37 // of the intervals | |
| 38 if (fDashArrayLength > 0) { | 37 if (fDashArrayLength > 0) { |
| 39 paint->setPathEffect(new SkDashPathEffect(fDashArray, | 38 paint->setPathEffect(new SkDashPathEffect(fDashArray, |
| 40 fDashArrayLength, | 39 fDashArrayLength, |
| 41 fDashPhase))->unref(); | 40 fDashPhase))->unref(); |
| 42 } | 41 } |
| 43 } | 42 } |
| 44 | 43 |
| 45 // TODO(edisonn): NYI multiple blend modes | 44 // TODO(edisonn): NYI multiple blend modes |
| 46 if (fBlendModesLength == 1 && fBlendModes[0] != SkXfermode::kSrc_Mode) { | 45 if (fBlendModesLength == 1 && fBlendModes[0] != SkXfermode::kSrc_Mode) { |
| 47 paint->setXfermodeMode(fBlendModes[0]); | 46 paint->setXfermodeMode(fBlendModes[0]); |
| 48 } | 47 } |
| 49 | 48 |
| 50 //paint->setStrokeMiter(SkDoubleToScalar(fMiterLimit)); | 49 //paint->setStrokeMiter(SkDoubleToScalar(fMiterLimit)); |
| 51 // TODO(edisonn): impl cap and join | 50 // TODO(edisonn): impl cap and join |
| 52 } | 51 } |
| OLD | NEW |