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

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

Issue 925343003: use common impl for drawTextOnPath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move includes to the top 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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 align_text(glyphCacheProc, textPaint, glyphIDs + i, 1, &x, &y); 1187 align_text(glyphCacheProc, textPaint, glyphIDs + i, 1, &x, &y);
1188 set_text_transform(x, y, textPaint.getTextSkewX(), &content.entry()->fCo ntent); 1188 set_text_transform(x, y, textPaint.getTextSkewX(), &content.entry()->fCo ntent);
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,
1198 const SkPath& path, const SkMatrix* matrix,
1199 const SkPaint& paint) {
1200 if (d.fClip->isEmpty()) {
1201 return;
1202 }
1203 d.drawTextOnPath((const char*)text, len, path, matrix, paint);
1204 }
1205
1206 void SkPDFDevice::drawVertices(const SkDraw& d, SkCanvas::VertexMode, 1197 void SkPDFDevice::drawVertices(const SkDraw& d, SkCanvas::VertexMode,
1207 int vertexCount, const SkPoint verts[], 1198 int vertexCount, const SkPoint verts[],
1208 const SkPoint texs[], const SkColor colors[], 1199 const SkPoint texs[], const SkColor colors[],
1209 SkXfermode* xmode, const uint16_t indices[], 1200 SkXfermode* xmode, const uint16_t indices[],
1210 int indexCount, const SkPaint& paint) { 1201 int indexCount, const SkPaint& paint) {
1211 if (d.fClip->isEmpty()) { 1202 if (d.fClip->isEmpty()) {
1212 return; 1203 return;
1213 } 1204 }
1214 // TODO: implement drawVertices 1205 // TODO: implement drawVertices
1215 } 1206 }
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 SkAutoTUnref<SkPDFObject> image( 2180 SkAutoTUnref<SkPDFObject> image(
2190 SkPDFCreateImageObject(*bitmap, subset, fEncoder)); 2181 SkPDFCreateImageObject(*bitmap, subset, fEncoder));
2191 if (!image) { 2182 if (!image) {
2192 return; 2183 return;
2193 } 2184 }
2194 2185
2195 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2186 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2196 &content.entry()->fContent); 2187 &content.entry()->fContent);
2197 } 2188 }
2198 2189
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698