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

Side by Side Diff: src/pdf/SkPDFDevice.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/core/SkStream.cpp ('k') | src/pdf/SkPDFUtils.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 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 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 GraphicStackState gsState(fExistingClipStack, fExistingClipRegion, data); 1314 GraphicStackState gsState(fExistingClipStack, fExistingClipRegion, data);
1315 while (entry != NULL) { 1315 while (entry != NULL) {
1316 SkPoint translation; 1316 SkPoint translation;
1317 translation.iset(this->getOrigin()); 1317 translation.iset(this->getOrigin());
1318 translation.negate(); 1318 translation.negate();
1319 gsState.updateClip(entry->fState.fClipStack, entry->fState.fClipRegion, 1319 gsState.updateClip(entry->fState.fClipStack, entry->fState.fClipRegion,
1320 translation); 1320 translation);
1321 gsState.updateMatrix(entry->fState.fMatrix); 1321 gsState.updateMatrix(entry->fState.fMatrix);
1322 gsState.updateDrawingState(entry->fState); 1322 gsState.updateDrawingState(entry->fState);
1323 1323
1324 SkAutoDataUnref copy(entry->fContent.copyToData()); 1324 entry->fContent.writeToStream(data);
1325 data->write(copy->data(), copy->size());
1326 entry = entry->fNext.get(); 1325 entry = entry->fNext.get();
1327 } 1326 }
1328 gsState.drainStack(); 1327 gsState.drainStack();
1329 } 1328 }
1330 1329
1331 SkData* SkPDFDevice::copyContentToData() const { 1330 SkData* SkPDFDevice::copyContentToData() const {
1332 SkDynamicMemoryWStream data; 1331 SkDynamicMemoryWStream data;
1333 if (fInitialTransform.getType() != SkMatrix::kIdentity_Mask) { 1332 if (fInitialTransform.getType() != SkMatrix::kIdentity_Mask) {
1334 SkPDFUtils::AppendTransform(fInitialTransform, &data); 1333 SkPDFUtils::AppendTransform(fInitialTransform, &data);
1335 } 1334 }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2136 2135
2137 SkAutoTUnref<SkPDFObject> image( 2136 SkAutoTUnref<SkPDFObject> image(
2138 SkPDFCreateImageObject(fCanon, *bitmap, subset)); 2137 SkPDFCreateImageObject(fCanon, *bitmap, subset));
2139 if (!image) { 2138 if (!image) {
2140 return; 2139 return;
2141 } 2140 }
2142 2141
2143 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2142 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2144 &content.entry()->fContent); 2143 &content.entry()->fContent);
2145 } 2144 }
OLDNEW
« no previous file with comments | « src/core/SkStream.cpp ('k') | src/pdf/SkPDFUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698