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 "SkPdfRenderer.h" | 8 #include "SkPdfRenderer.h" |
9 | 9 |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 | 1062 |
1063 SkMatrix matrix = SkMatrixFromPdfMatrix(array); | 1063 SkMatrix matrix = SkMatrixFromPdfMatrix(array); |
1064 matrix.postConcat(pdfContext->fGraphicsState.fCTM); | 1064 matrix.postConcat(pdfContext->fGraphicsState.fCTM); |
1065 matrix.preScale(SkDoubleToScalar(1), SkDoubleToScalar(-1)); | 1065 matrix.preScale(SkDoubleToScalar(1), SkDoubleToScalar(-1)); |
1066 | 1066 |
1067 // TODO(edisonn): NYI - Text positioning. | 1067 // TODO(edisonn): NYI - Text positioning. |
1068 SkPdfReport(kCodeWarning_SkPdfIssueSeverity, kNYI_SkPdfIssue, | 1068 SkPdfReport(kCodeWarning_SkPdfIssueSeverity, kNYI_SkPdfIssue, |
1069 "Text positioning not implemented for 2+ chars", NULL, pdfContex
t); | 1069 "Text positioning not implemented for 2+ chars", NULL, pdfContex
t); |
1070 | 1070 |
1071 pdfContext->fGraphicsState.fMatrixTm = matrix; | 1071 pdfContext->fGraphicsState.fMatrixTm = matrix; |
1072 pdfContext->fGraphicsState.fMatrixTlm = matrix;; | 1072 pdfContext->fGraphicsState.fMatrixTlm = matrix; |
1073 | 1073 |
1074 return kPartial_SkPdfResult; | 1074 return kPartial_SkPdfResult; |
1075 } | 1075 } |
1076 | 1076 |
1077 //— T* Move to the start of the next line. This operator has the same effect as
the code | 1077 //— T* Move to the start of the next line. This operator has the same effect as
the code |
1078 //0 Tl Td | 1078 //0 Tl Td |
1079 //where Tl is the current leading parameter in the text state | 1079 //where Tl is the current leading parameter in the text state |
1080 static SkPdfResult PdfOp_T_star(SkPdfContext* pdfContext, SkCanvas* canvas, | 1080 static SkPdfResult PdfOp_T_star(SkPdfContext* pdfContext, SkCanvas* canvas, |
1081 SkPdfTokenLooper* parentLooper) { | 1081 SkPdfTokenLooper* parentLooper) { |
1082 SkPdfReal* zero = pdfContext->fPdfDoc->createReal(0.0); | 1082 SkPdfReal* zero = pdfContext->fPdfDoc->createReal(0.0); |
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2908 | 2908 |
2909 rect = SkRect::MakeWH(width, height); | 2909 rect = SkRect::MakeWH(width, height); |
2910 | 2910 |
2911 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height)); | 2911 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height)); |
2912 | 2912 |
2913 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); | 2913 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); |
2914 SkCanvas canvas(device); | 2914 SkCanvas canvas(device); |
2915 | 2915 |
2916 return renderer->renderPage(page, &canvas, rect); | 2916 return renderer->renderPage(page, &canvas, rect); |
2917 } | 2917 } |
OLD | NEW |