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

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 1763143002: WIP RasterCanvasLayerAllocator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add allocator-constancy sanitycheck Created 4 years, 9 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
« src/core/SkCanvas.cpp ('K') | « src/pdf/SkPDFDevice.h ('k') | no next file » | 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 "SkAnnotationKeys.h" 10 #include "SkAnnotationKeys.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // PDF does not support image filters, so render them on CPU. 572 // PDF does not support image filters, so render them on CPU.
573 // Note that this rendering is done at "screen" resolution (100dpi), not 573 // Note that this rendering is done at "screen" resolution (100dpi), not
574 // printer resolution. 574 // printer resolution.
575 // TODO: It may be possible to express some filters natively using PDF 575 // TODO: It may be possible to express some filters natively using PDF
576 // to improve quality and file size (https://bug.skia.org/3043) 576 // to improve quality and file size (https://bug.skia.org/3043)
577 577
578 // TODO: should we return true if there is a colorfilter? 578 // TODO: should we return true if there is a colorfilter?
579 return layerPaint.getImageFilter() != nullptr; 579 return layerPaint.getImageFilter() != nullptr;
580 } 580 }
581 581
582 SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint * layerPaint) { 582 SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint * layerPaint,
583 SkRasterCanvasLayerAllocator*) {
583 if (cinfo.fForImageFilter || 584 if (cinfo.fForImageFilter ||
584 (layerPaint && not_supported_for_layers(*layerPaint))) { 585 (layerPaint && not_supported_for_layers(*layerPaint))) {
585 return nullptr; 586 return nullptr;
586 } 587 }
587 SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height()); 588 SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height());
588 return SkPDFDevice::Create(size, fRasterDpi, fDocument); 589 return SkPDFDevice::Create(size, fRasterDpi, fDocument);
589 } 590 }
590 591
591 SkPDFCanon* SkPDFDevice::getCanon() const { return fDocument->canon(); } 592 SkPDFCanon* SkPDFDevice::getCanon() const { return fDocument->canon(); }
592 593
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2274 sk_sp<SkData> encodedImage(image->refEncodedData()); 2275 sk_sp<SkData> encodedImage(image->refEncodedData());
2275 if (!encodedImage) { 2276 if (!encodedImage) {
2276 fDocument->serialize(pdfimage); 2277 fDocument->serialize(pdfimage);
2277 } 2278 }
2278 #endif 2279 #endif
2279 fDocument->canon()->addPDFBitmap(image->uniqueID(), pdfimage.get()); 2280 fDocument->canon()->addPDFBitmap(image->uniqueID(), pdfimage.get());
2280 } 2281 }
2281 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), 2282 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()),
2282 &content.entry()->fContent); 2283 &content.entry()->fContent);
2283 } 2284 }
OLDNEW
« src/core/SkCanvas.cpp ('K') | « src/pdf/SkPDFDevice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698