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

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: formatting 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
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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 // 0 1 2 3 4 5 6 7 8 9 10 710 // 0 1 2 3 4 5 6 7 8 9 10
711 // FF D8 FF E0 ?? ?? 'J' 'F' 'I' 'F' 00 ... 711 // FF D8 FF E0 ?? ?? 'J' 'F' 'I' 'F' 00 ...
712 return ((0 == memcmp(data->bytes(), bytesZeroToThree, 712 return ((0 == memcmp(data->bytes(), bytesZeroToThree,
713 sizeof(bytesZeroToThree))) 713 sizeof(bytesZeroToThree)))
714 && (0 == memcmp(data->bytes() + 6, bytesSixToTen, 714 && (0 == memcmp(data->bytes() + 6, bytesSixToTen,
715 sizeof(bytesSixToTen)))); 715 sizeof(bytesSixToTen))));
716 } 716 }
717 } // namespace 717 } // namespace
718 #endif 718 #endif
719 719
720 SkPDFObject* SkPDFCreateImageObject( 720 SkPDFObject* SkPDFCreateImageObject(SkPDFCanon* canon,
721 const SkBitmap& bitmap, 721 const SkBitmap& bitmap,
722 const SkIRect& subset, 722 const SkIRect& subset,
723 SkPicture::EncodeBitmap encoder) { 723 SkPicture::EncodeBitmap encoder) {
724 if (SkPDFObject* pdfBitmap = SkPDFBitmap::Create(bitmap, subset)) { 724 if (SkPDFObject* pdfBitmap = SkPDFBitmap::Create(canon, bitmap, subset)) {
725 return pdfBitmap; 725 return pdfBitmap;
726 } 726 }
727 #if 0 // reenable when we can figure out the JPEG colorspace 727 #if 0 // reenable when we can figure out the JPEG colorspace
728 if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) { 728 if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) {
729 SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap)); 729 SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap));
730 if (is_jfif_jpeg(encodedData)) { 730 if (is_jfif_jpeg(encodedData)) {
731 return SkNEW_ARGS(PDFJPEGImage, 731 return SkNEW_ARGS(PDFJPEGImage,
732 (encodedData, bitmap.width(), bitmap.height())); 732 (encodedData, bitmap.width(), bitmap.height()));
733 } 733 }
734 } 734 }
735 #endif 735 #endif
736 return SkPDFImage::CreateImage(bitmap, subset, encoder); 736 return SkPDFImage::CreateImage(bitmap, subset, encoder);
737 } 737 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698