OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |