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

Unified Diff: src/pdf/SkPDFImage.cpp

Issue 918813002: PDF: Add (low-memory) SkPDFBitmap class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mutable bitmaps get copied 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFCanon.cpp ('k') | tests/DeflateWStream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFImage.cpp
diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp
index 0b6c81f77a382a6cded9bdc61db3b27f8f623e76..dab74736847b9d6096d04567d85c1742c542a04d 100644
--- a/src/pdf/SkPDFImage.cpp
+++ b/src/pdf/SkPDFImage.cpp
@@ -12,6 +12,7 @@
#include "SkColorPriv.h"
#include "SkData.h"
#include "SkFlate.h"
+#include "SkPDFBitmap.h"
#include "SkPDFCatalog.h"
#include "SkPixelRef.h"
#include "SkRect.h"
@@ -728,6 +729,9 @@ SkPDFObject* SkPDFCreateImageObject(
const SkBitmap& bitmap,
const SkIRect& subset,
SkPicture::EncodeBitmap encoder) {
+ if (SkPDFObject* pdfBitmap = SkPDFBitmap::Create(bitmap, subset)) {
+ return pdfBitmap;
+ }
#if 0 // reenable when we can figure out the JPEG colorspace
if (SkIRect::MakeWH(bitmap.width(), bitmap.height()) == subset) {
SkAutoTUnref<SkData> encodedData(ref_encoded_data(bitmap));
« no previous file with comments | « src/pdf/SkPDFCanon.cpp ('k') | tests/DeflateWStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698