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 <tuple> | 8 #include <tuple> |
9 #include "SkPDFDevice.h" | 9 #include "SkPDFDevice.h" |
10 | 10 |
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2426 // drawBitmap*()/drawImage*() calls amd ImageFilters (which | 2426 // drawBitmap*()/drawImage*() calls amd ImageFilters (which |
2427 // rasterize a layer on this backend). Fortuanely, this seems | 2427 // rasterize a layer on this backend). Fortuanely, this seems |
2428 // to be how Chromium impements most color-filters. | 2428 // to be how Chromium impements most color-filters. |
2429 autoImageUnref.reset(color_filter(image, colorFilter)); | 2429 autoImageUnref.reset(color_filter(image, colorFilter)); |
2430 image = autoImageUnref; | 2430 image = autoImageUnref; |
2431 // TODO(halcanary): de-dupe this by caching filtered images. | 2431 // TODO(halcanary): de-dupe this by caching filtered images. |
2432 // (maybe in the resource cache?) | 2432 // (maybe in the resource cache?) |
2433 } | 2433 } |
2434 SkAutoTUnref<SkPDFObject> pdfimage(SkSafeRef(fCanon->findPDFBitmap(image))); | 2434 SkAutoTUnref<SkPDFObject> pdfimage(SkSafeRef(fCanon->findPDFBitmap(image))); |
2435 if (!pdfimage) { | 2435 if (!pdfimage) { |
2436 pdfimage.reset(SkPDFCreateBitmapObject(image)); | 2436 pdfimage.reset(SkPDFCreateBitmapObject( |
| 2437 image, fCanon->fPixelSerializer)); |
2437 if (!pdfimage) { | 2438 if (!pdfimage) { |
2438 return; | 2439 return; |
2439 } | 2440 } |
2440 fCanon->addPDFBitmap(image->uniqueID(), pdfimage); | 2441 fCanon->addPDFBitmap(image->uniqueID(), pdfimage); |
2441 } | 2442 } |
2442 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), | 2443 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), |
2443 &content.entry()->fContent); | 2444 &content.entry()->fContent); |
2444 } | 2445 } |
OLD | NEW |