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

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

Issue 19790007: Revert "Adds SkPDFResourceDict class to manage resource dicts. Refactors existing code to use this … (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkData.h" 10 #include "SkData.h"
11 #include "SkGeometry.h" 11 #include "SkGeometry.h"
12 #include "SkPaint.h" 12 #include "SkPaint.h"
13 #include "SkPath.h" 13 #include "SkPath.h"
14 #include "SkPDFResourceDict.h"
15 #include "SkPDFUtils.h" 14 #include "SkPDFUtils.h"
16 #include "SkStream.h" 15 #include "SkStream.h"
17 #include "SkString.h" 16 #include "SkString.h"
18 #include "SkPDFTypes.h" 17 #include "SkPDFTypes.h"
19 18
20 // static 19 // static
21 SkPDFArray* SkPDFUtils::MatrixToArray(const SkMatrix& matrix) { 20 SkPDFArray* SkPDFUtils::MatrixToArray(const SkMatrix& matrix) {
22 SkScalar values[6]; 21 SkScalar values[6];
23 if (!matrix.asAffine(values)) { 22 if (!matrix.asAffine(values)) {
24 SkMatrix::SetAffineIdentity(values); 23 SkMatrix::SetAffineIdentity(values);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 199 }
201 200
202 // static 201 // static
203 void SkPDFUtils::StrokePath(SkWStream* content) { 202 void SkPDFUtils::StrokePath(SkWStream* content) {
204 SkPDFUtils::PaintPath( 203 SkPDFUtils::PaintPath(
205 SkPaint::kStroke_Style, SkPath::kWinding_FillType, content); 204 SkPaint::kStroke_Style, SkPath::kWinding_FillType, content);
206 } 205 }
207 206
208 // static 207 // static
209 void SkPDFUtils::DrawFormXObject(int objectIndex, SkWStream* content) { 208 void SkPDFUtils::DrawFormXObject(int objectIndex, SkWStream* content) {
210 content->writeText("/"); 209 content->writeText("/X");
211 content->writeText(SkPDFResourceDict::getResourceName( 210 content->writeDecAsText(objectIndex);
212 SkPDFResourceDict::kXObject_ResourceType,
213 objectIndex).c_str());
214 content->writeText(" Do\n"); 211 content->writeText(" Do\n");
215 } 212 }
216 213
217 // static 214 // static
218 void SkPDFUtils::ApplyGraphicState(int objectIndex, SkWStream* content) { 215 void SkPDFUtils::ApplyGraphicState(int objectIndex, SkWStream* content) {
219 content->writeText("/"); 216 content->writeText("/G");
220 content->writeText(SkPDFResourceDict::getResourceName( 217 content->writeDecAsText(objectIndex);
221 SkPDFResourceDict::kExtGState_ResourceType,
222 objectIndex).c_str());
223 content->writeText(" gs\n"); 218 content->writeText(" gs\n");
224 } 219 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698