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

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

Issue 2190643002: SkPDF: refactor font subset: fewer copies (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-07-27 (Wednesday) 16:22:36 EDT Created 4 years, 4 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 | « no previous file | src/pdf/SkPDFFont.cpp » ('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 "SkColorSpace_Base.h" 8 #include "SkColorSpace_Base.h"
9 #include "SkPDFCanvas.h" 9 #include "SkPDFCanvas.h"
10 #include "SkPDFDevice.h" 10 #include "SkPDFDevice.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 } 314 }
315 #endif // SK_SUPPORT_LEGACY_DOCUMENT_API 315 #endif // SK_SUPPORT_LEGACY_DOCUMENT_API
316 316
317 static sk_sp<SkData> SkSrgbIcm() { 317 static sk_sp<SkData> SkSrgbIcm() {
318 auto srgb = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 318 auto srgb = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
319 return as_CSB(srgb)->writeToICC(); 319 return as_CSB(srgb)->writeToICC();
320 } 320 }
321 321
322 static sk_sp<SkPDFStream> make_srgb_color_profile() { 322 static sk_sp<SkPDFStream> make_srgb_color_profile() {
323 sk_sp<SkData> profile = SkSrgbIcm(); 323 sk_sp<SkPDFStream> stream = sk_make_sp<SkPDFStream>(SkSrgbIcm());
324 sk_sp<SkPDFStream> stream = sk_make_sp<SkPDFStream>(profile.get());
325 stream->insertInt("N", 3); 324 stream->insertInt("N", 3);
326 sk_sp<SkPDFArray> array = sk_make_sp<SkPDFArray>(); 325 sk_sp<SkPDFArray> array = sk_make_sp<SkPDFArray>();
327 array->appendScalar(0.0f); 326 array->appendScalar(0.0f);
328 array->appendScalar(1.0f); 327 array->appendScalar(1.0f);
329 array->appendScalar(0.0f); 328 array->appendScalar(0.0f);
330 array->appendScalar(1.0f); 329 array->appendScalar(1.0f);
331 array->appendScalar(0.0f); 330 array->appendScalar(0.0f);
332 array->appendScalar(1.0f); 331 array->appendScalar(1.0f);
333 stream->insertObject("Range", std::move(array)); 332 stream->insertObject("Range", std::move(array));
334 return stream; 333 return stream;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 416 }
418 417
419 sk_sp<SkDocument> SkDocument::MakePDF(SkWStream* stream, 418 sk_sp<SkDocument> SkDocument::MakePDF(SkWStream* stream,
420 SkScalar dpi, 419 SkScalar dpi,
421 const SkDocument::PDFMetadata& metadata, 420 const SkDocument::PDFMetadata& metadata,
422 sk_sp<SkPixelSerializer> jpegEncoder, 421 sk_sp<SkPixelSerializer> jpegEncoder,
423 bool pdfa) { 422 bool pdfa) {
424 return SkPDFMakeDocument(stream, nullptr, dpi, metadata, 423 return SkPDFMakeDocument(stream, nullptr, dpi, metadata,
425 std::move(jpegEncoder), pdfa); 424 std::move(jpegEncoder), pdfa);
426 } 425 }
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698