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

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

Issue 943423002: SkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-02-23 (Monday) 15:03:08 EST 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
« no previous file with comments | « src/pdf/SkPDFDevice.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"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 } break; 169 } break;
170 case SkPath::kCubic_Verb: 170 case SkPath::kCubic_Verb:
171 AppendCubic(args[1].fX, args[1].fY, args[2].fX, args[2].fY, 171 AppendCubic(args[1].fX, args[1].fY, args[2].fX, args[2].fY,
172 args[3].fX, args[3].fY, &currentSegment); 172 args[3].fX, args[3].fY, &currentSegment);
173 fillState = kNonSingleLine_SkipFillState; 173 fillState = kNonSingleLine_SkipFillState;
174 break; 174 break;
175 case SkPath::kClose_Verb: 175 case SkPath::kClose_Verb:
176 if (fillState != kSingleLine_SkipFillState) { 176 if (fillState != kSingleLine_SkipFillState) {
177 ClosePath(&currentSegment); 177 ClosePath(&currentSegment);
178 SkData* data = currentSegment.copyToData(); 178 currentSegment.writeToStream(content);
179 content->write(data->data(), data->size());
180 data->unref();
181 } 179 }
182 currentSegment.reset(); 180 currentSegment.reset();
183 break; 181 break;
184 default: 182 default:
185 SkASSERT(false); 183 SkASSERT(false);
186 break; 184 break;
187 } 185 }
188 } 186 }
189 if (currentSegment.bytesWritten() > 0) { 187 if (currentSegment.bytesWritten() > 0) {
190 SkData* data = currentSegment.copyToData(); 188 currentSegment.writeToStream(content);
191 content->write(data->data(), data->size());
192 data->unref();
193 } 189 }
194 } 190 }
195 191
196 // static 192 // static
197 void SkPDFUtils::ClosePath(SkWStream* content) { 193 void SkPDFUtils::ClosePath(SkWStream* content) {
198 content->writeText("h\n"); 194 content->writeText("h\n");
199 } 195 }
200 196
201 // static 197 // static
202 void SkPDFUtils::PaintPath(SkPaint::Style style, SkPath::FillType fill, 198 void SkPDFUtils::PaintPath(SkPaint::Style style, SkPath::FillType fill,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // color (SCN, scn) 245 // color (SCN, scn)
250 SkString resourceName = SkPDFResourceDict::getResourceName( 246 SkString resourceName = SkPDFResourceDict::getResourceName(
251 SkPDFResourceDict::kPattern_ResourceType, 247 SkPDFResourceDict::kPattern_ResourceType,
252 objectIndex); 248 objectIndex);
253 content->writeText("/Pattern CS/Pattern cs/"); 249 content->writeText("/Pattern CS/Pattern cs/");
254 content->writeText(resourceName.c_str()); 250 content->writeText(resourceName.c_str());
255 content->writeText(" SCN/"); 251 content->writeText(" SCN/");
256 content->writeText(resourceName.c_str()); 252 content->writeText(resourceName.c_str());
257 content->writeText(" scn\n"); 253 content->writeText(" scn\n");
258 } 254 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698