Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: src/pdf/SkPDFDeviceFlattener.cpp

Issue 605533002: Fix SkTextBlob offset semantics. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: default run positioning fix Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFDeviceFlattener.h ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 SkScalar x, SkScalar y, const SkPaint& paint ) { 116 SkScalar x, SkScalar y, const SkPaint& paint ) {
117 if (mustPathText(d, paint)) { 117 if (mustPathText(d, paint)) {
118 d.drawText_asPaths((const char*)text, len, x, y, paint); 118 d.drawText_asPaths((const char*)text, len, x, y, paint);
119 return; 119 return;
120 } 120 }
121 121
122 INHERITED::drawText(d, text, len, x, y, paint); 122 INHERITED::drawText(d, text, len, x, y, paint);
123 } 123 }
124 124
125 void SkPDFDeviceFlattener::drawPosText(const SkDraw& d, const void* text, size_t len, 125 void SkPDFDeviceFlattener::drawPosText(const SkDraw& d, const void* text, size_t len,
126 const SkScalar pos[], SkScalar constY, 126 const SkScalar pos[], int scalarsPerPos,
127 int scalarsPerPos, const SkPaint& paint) { 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, constY, scalarsPerPos , 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, constY,scalarsPerPos, 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 const SkPaint& paint) { 137 const SkPaint& paint) {
138 if (mustPathText(d, paint) || (matrix && matrix->hasPerspective())) { 138 if (mustPathText(d, paint) || (matrix && matrix->hasPerspective())) {
139 d.drawTextOnPath((const char*)text, len, path, matrix, paint); 139 d.drawTextOnPath((const char*)text, len, path, matrix, paint);
140 return; 140 return;
141 } 141 }
142 INHERITED::drawTextOnPath(d, text, len, path, matrix, paint); 142 INHERITED::drawTextOnPath(d, text, len, path, matrix, paint);
143 } 143 }
144 144
145 bool SkPDFDeviceFlattener::mustFlatten(const SkDraw& d) const { 145 bool SkPDFDeviceFlattener::mustFlatten(const SkDraw& d) const {
146 // TODO(edisonn): testability, add flag to force return true. 146 // TODO(edisonn): testability, add flag to force return true.
147 return d.fMatrix->hasPerspective(); 147 return d.fMatrix->hasPerspective();
148 } 148 }
149 149
150 bool SkPDFDeviceFlattener::mustPathText(const SkDraw& d, const SkPaint&) { 150 bool SkPDFDeviceFlattener::mustPathText(const SkDraw& d, const SkPaint&) {
151 // TODO(edisonn): testability, add flag to force return true. 151 // TODO(edisonn): testability, add flag to force return true.
152 // TODO(edisonn): TBD: How to flatten MaskFilter. 152 // TODO(edisonn): TBD: How to flatten MaskFilter.
153 return d.fMatrix->hasPerspective(); 153 return d.fMatrix->hasPerspective();
154 } 154 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDeviceFlattener.h ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698