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

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

Issue 933483002: add Method param to drawTextOnPath, supporting SVG spec Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add guard for android Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 SkString encodedString = 1189 SkString encodedString =
1190 SkPDFString::FormatString(&encodedValue, 1, font->multiByteGlyphs()) ; 1190 SkPDFString::FormatString(&encodedValue, 1, font->multiByteGlyphs()) ;
1191 content.entry()->fContent.writeText(encodedString.c_str()); 1191 content.entry()->fContent.writeText(encodedString.c_str());
1192 content.entry()->fContent.writeText(" Tj\n"); 1192 content.entry()->fContent.writeText(" Tj\n");
1193 } 1193 }
1194 content.entry()->fContent.writeText("ET\n"); 1194 content.entry()->fContent.writeText("ET\n");
1195 } 1195 }
1196 1196
1197 void SkPDFDevice::drawTextOnPath(const SkDraw& d, const void* text, size_t len, 1197 void SkPDFDevice::drawTextOnPath(const SkDraw& d, const void* text, size_t len,
1198 const SkPath& path, const SkMatrix* matrix, 1198 const SkPath& path, const SkMatrix* matrix,
1199 const SkPaint& paint) { 1199 SK_SUPPORT_LEGACY_DRAWTEXTONPATH_PARAM const Sk Paint& paint) {
1200 if (d.fClip->isEmpty()) { 1200 if (d.fClip->isEmpty()) {
1201 return; 1201 return;
1202 } 1202 }
1203 d.drawTextOnPath((const char*)text, len, path, matrix, paint); 1203 SK_SUPPORT_LEGACY_DRAWTEXTONPATH_DEFAULT_METHOD
1204 d.drawTextOnPath((const char*)text, len, path, matrix, method, paint);
1204 } 1205 }
1205 1206
1206 void SkPDFDevice::drawVertices(const SkDraw& d, SkCanvas::VertexMode, 1207 void SkPDFDevice::drawVertices(const SkDraw& d, SkCanvas::VertexMode,
1207 int vertexCount, const SkPoint verts[], 1208 int vertexCount, const SkPoint verts[],
1208 const SkPoint texs[], const SkColor colors[], 1209 const SkPoint texs[], const SkColor colors[],
1209 SkXfermode* xmode, const uint16_t indices[], 1210 SkXfermode* xmode, const uint16_t indices[],
1210 int indexCount, const SkPaint& paint) { 1211 int indexCount, const SkPaint& paint) {
1211 if (d.fClip->isEmpty()) { 1212 if (d.fClip->isEmpty()) {
1212 return; 1213 return;
1213 } 1214 }
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 SkAutoTUnref<SkPDFObject> image( 2190 SkAutoTUnref<SkPDFObject> image(
2190 SkPDFCreateImageObject(*bitmap, subset, fEncoder)); 2191 SkPDFCreateImageObject(*bitmap, subset, fEncoder));
2191 if (!image) { 2192 if (!image) {
2192 return; 2193 return;
2193 } 2194 }
2194 2195
2195 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2196 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2196 &content.entry()->fContent); 2197 &content.entry()->fContent);
2197 } 2198 }
2198 2199
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698