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

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

Issue 944643002: PDF: Now threadsafe! (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO=DONE Created 5 years, 10 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/SkPDFImage.h ('k') | src/pdf/SkPDFShader.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 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
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 "SkPDFImage.h" 8 #include "SkPDFImage.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // 0 1 2 3 4 5 6 7 8 9 10 680 // 0 1 2 3 4 5 6 7 8 9 10
681 // FF D8 FF E0 ?? ?? 'J' 'F' 'I' 'F' 00 ... 681 // FF D8 FF E0 ?? ?? 'J' 'F' 'I' 'F' 00 ...
682 return ((0 == memcmp(data->bytes(), bytesZeroToThree, 682 return ((0 == memcmp(data->bytes(), bytesZeroToThree,
683 sizeof(bytesZeroToThree))) 683 sizeof(bytesZeroToThree)))
684 && (0 == memcmp(data->bytes() + 6, bytesSixToTen, 684 && (0 == memcmp(data->bytes() + 6, bytesSixToTen,
685 sizeof(bytesSixToTen)))); 685 sizeof(bytesSixToTen))));
686 } 686 }
687 } // namespace 687 } // namespace
688 #endif 688 #endif
689 689
690 SkPDFObject* SkPDFCreateImageObject( 690 SkPDFObject* SkPDFCreateImageObject(SkPDFCanon* canon,
691 const SkBitmap& bitmap, 691 const SkBitmap& bitmap,
692 const SkIRect& subset) { 692 const SkIRect& subset) {
693 if (SkPDFObject* pdfBitmap = SkPDFBitmap::Create(bitmap, subset)) { 693 if (SkPDFObject* pdfBitmap = SkPDFBitmap::Create(canon, bitmap, subset)) {
694 return pdfBitmap; 694 return pdfBitmap;
695 } 695 }
696 #if 0 // reenable when we can figure out the JPEG colorspace 696 #if 0 // reenable when we can figure out the JPEG colorspace
697 if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) { 697 if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) {
698 SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap)); 698 SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap));
699 if (is_jfif_jpeg(encodedData)) { 699 if (is_jfif_jpeg(encodedData)) {
700 return SkNEW_ARGS(PDFJPEGImage, 700 return SkNEW_ARGS(PDFJPEGImage,
701 (encodedData, bitmap.width(), bitmap.height())); 701 (encodedData, bitmap.width(), bitmap.height()));
702 } 702 }
703 } 703 }
704 #endif 704 #endif
705 return SkPDFImage::CreateImage(bitmap, subset); 705 return SkPDFImage::CreateImage(bitmap, subset);
706 } 706 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFImage.h ('k') | src/pdf/SkPDFShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698