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

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

Issue 2309483002: WIP RasterCanvasLayerAllocator experiment 2
Patch Set: vend smart pointers to SkCanvas Created 4 years, 2 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
« no previous file with comments | « src/pdf/SkPDFDevice.h ('k') | src/xps/SkXPSDevice.h » ('j') | 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 "SkAdvancedTypefaceMetrics.h" 10 #include "SkAdvancedTypefaceMetrics.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 // PDF does not support image filters, so render them on CPU. 341 // PDF does not support image filters, so render them on CPU.
342 // Note that this rendering is done at "screen" resolution (100dpi), not 342 // Note that this rendering is done at "screen" resolution (100dpi), not
343 // printer resolution. 343 // printer resolution.
344 // TODO: It may be possible to express some filters natively using PDF 344 // TODO: It may be possible to express some filters natively using PDF
345 // to improve quality and file size (https://bug.skia.org/3043) 345 // to improve quality and file size (https://bug.skia.org/3043)
346 346
347 // TODO: should we return true if there is a colorfilter? 347 // TODO: should we return true if there is a colorfilter?
348 return layerPaint.getImageFilter() != nullptr; 348 return layerPaint.getImageFilter() != nullptr;
349 } 349 }
350 350
351 SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint * layerPaint) { 351 SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint * layerPaint,
352 SkRasterCanvasLayerAllocator*) {
352 if (layerPaint && not_supported_for_layers(*layerPaint)) { 353 if (layerPaint && not_supported_for_layers(*layerPaint)) {
353 // need to return a raster device, which we will detect in drawDevice() 354 // need to return a raster device, which we will detect in drawDevice()
354 return SkBitmapDevice::Create(cinfo.fInfo, SkSurfaceProps(0, kUnknown_Sk PixelGeometry)); 355 return SkBitmapDevice::Create(cinfo.fInfo, SkSurfaceProps(0, kUnknown_Sk PixelGeometry));
355 } 356 }
356 SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height()); 357 SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height());
357 return SkPDFDevice::Create(size, fRasterDpi, fDocument); 358 return SkPDFDevice::Create(size, fRasterDpi, fDocument);
358 } 359 }
359 360
360 SkPDFCanon* SkPDFDevice::getCanon() const { return fDocument->canon(); } 361 SkPDFCanon* SkPDFDevice::getCanon() const { return fDocument->canon(); }
361 362
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 } 2310 }
2310 2311
2311 sk_sp<SkSpecialImage> SkPDFDevice::makeSpecial(const SkImage* image) { 2312 sk_sp<SkSpecialImage> SkPDFDevice::makeSpecial(const SkImage* image) {
2312 return SkSpecialImage::MakeFromImage(SkIRect::MakeWH(image->width(), image-> height()), 2313 return SkSpecialImage::MakeFromImage(SkIRect::MakeWH(image->width(), image-> height()),
2313 image->makeNonTextureImage()); 2314 image->makeNonTextureImage());
2314 } 2315 }
2315 2316
2316 sk_sp<SkSpecialImage> SkPDFDevice::snapSpecial() { 2317 sk_sp<SkSpecialImage> SkPDFDevice::snapSpecial() {
2317 return nullptr; 2318 return nullptr;
2318 } 2319 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.h ('k') | src/xps/SkXPSDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698