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 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2275 // TODO(http://skbug.com/4378): implement colorfilter on other | 2275 // TODO(http://skbug.com/4378): implement colorfilter on other |
2276 // draw calls. This code here works for all | 2276 // draw calls. This code here works for all |
2277 // drawBitmap*()/drawImage*() calls amd ImageFilters (which | 2277 // drawBitmap*()/drawImage*() calls amd ImageFilters (which |
2278 // rasterize a layer on this backend). Fortuanely, this seems | 2278 // rasterize a layer on this backend). Fortuanely, this seems |
2279 // to be how Chromium impements most color-filters. | 2279 // to be how Chromium impements most color-filters. |
2280 autoImageUnref.reset(color_filter(image, colorFilter)); | 2280 autoImageUnref.reset(color_filter(image, colorFilter)); |
2281 image = autoImageUnref; | 2281 image = autoImageUnref; |
2282 // TODO(halcanary): de-dupe this by caching filtered images. | 2282 // TODO(halcanary): de-dupe this by caching filtered images. |
2283 // (maybe in the resource cache?) | 2283 // (maybe in the resource cache?) |
2284 } | 2284 } |
2285 SkAutoTUnref<SkPDFObject> pdfimage(fCanon->findPDFBitmap(image)); | 2285 SkAutoTUnref<SkPDFObject> pdfimage(SkSafeRef(fCanon->findPDFBitmap(image))); |
2286 if (!pdfimage) { | 2286 if (!pdfimage) { |
2287 pdfimage.reset(SkPDFCreateBitmapObject(image)); | 2287 pdfimage.reset(SkPDFCreateBitmapObject(image)); |
2288 if (!pdfimage) { | 2288 if (!pdfimage) { |
2289 return; | 2289 return; |
2290 } | 2290 } |
2291 fCanon->addPDFBitmap(image->uniqueID(), pdfimage); | 2291 fCanon->addPDFBitmap(image->uniqueID(), pdfimage); |
2292 } | 2292 } |
2293 SkPDFUtils::DrawFormXObject(this->addXObjectResource(SkRef(pdfimage.get())), | 2293 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), |
2294 &content.entry()->fContent); | 2294 &content.entry()->fContent); |
2295 } | 2295 } |
OLD | NEW |