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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 // Canvas promises that this ptr is valid until onDetachFromCanvas is called | 1254 // Canvas promises that this ptr is valid until onDetachFromCanvas is called |
1255 fClipStack = canvas->getClipStack(); | 1255 fClipStack = canvas->getClipStack(); |
1256 } | 1256 } |
1257 | 1257 |
1258 void SkPDFDevice::onDetachFromCanvas() { | 1258 void SkPDFDevice::onDetachFromCanvas() { |
1259 INHERITED::onDetachFromCanvas(); | 1259 INHERITED::onDetachFromCanvas(); |
1260 | 1260 |
1261 fClipStack = NULL; | 1261 fClipStack = NULL; |
1262 } | 1262 } |
1263 | 1263 |
1264 SkSurface* SkPDFDevice::newSurface(const SkImageInfo& info) { | 1264 SkSurface* SkPDFDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { |
1265 return SkSurface::NewRaster(info); | 1265 return SkSurface::NewRaster(info, &props); |
1266 } | 1266 } |
1267 | 1267 |
1268 ContentEntry* SkPDFDevice::getLastContentEntry() { | 1268 ContentEntry* SkPDFDevice::getLastContentEntry() { |
1269 if (fDrawingArea == kContent_DrawingArea) { | 1269 if (fDrawingArea == kContent_DrawingArea) { |
1270 return fLastContentEntry; | 1270 return fLastContentEntry; |
1271 } else { | 1271 } else { |
1272 return fLastMarginContentEntry; | 1272 return fLastMarginContentEntry; |
1273 } | 1273 } |
1274 } | 1274 } |
1275 | 1275 |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 SkAutoTUnref<SkPDFObject> image( | 2185 SkAutoTUnref<SkPDFObject> image( |
2186 SkPDFCreateImageObject(*bitmap, subset, fEncoder)); | 2186 SkPDFCreateImageObject(*bitmap, subset, fEncoder)); |
2187 if (!image) { | 2187 if (!image) { |
2188 return; | 2188 return; |
2189 } | 2189 } |
2190 | 2190 |
2191 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), | 2191 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), |
2192 &content.entry()->fContent); | 2192 &content.entry()->fContent); |
2193 } | 2193 } |
2194 | 2194 |
OLD | NEW |