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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 950633003: PDF: remove last use of SkPDFImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-20 (Friday) 15:22:20 EDT Created 5 years, 9 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/SkPDFBitmap.cpp ('k') | src/pdf/SkPDFImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 273b958a8c6376e33d4aa151436a730a45b80b22..a0ad1343af4bba4291e6565ab8155b03b39cdb55 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -17,10 +17,10 @@
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPathOps.h"
+#include "SkPDFBitmap.h"
#include "SkPDFFont.h"
#include "SkPDFFormXObject.h"
#include "SkPDFGraphicState.h"
-#include "SkPDFImage.h"
#include "SkPDFResourceDict.h"
#include "SkPDFShader.h"
#include "SkPDFStream.h"
@@ -2126,7 +2126,7 @@ void SkPDFDevice::internalDrawBitmap(const SkMatrix& origMatrix,
if (content.needShape()) {
SkPath shape;
shape.addRect(SkRect::MakeWH(SkIntToScalar(subset.width()),
- SkIntToScalar( subset.height())));
+ SkIntToScalar(subset.height())));
shape.transform(matrix);
content.setShape(shape);
}
@@ -2134,8 +2134,12 @@ void SkPDFDevice::internalDrawBitmap(const SkMatrix& origMatrix,
return;
}
- SkAutoTUnref<SkPDFObject> image(
- SkPDFCreateImageObject(fCanon, *bitmap, subset));
+ SkBitmap subsetBitmap;
+ // Should extractSubset be done by the SkPDFDevice?
+ if (!bitmap->extractSubset(&subsetBitmap, subset)) {
+ return;
+ }
+ SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap));
if (!image) {
return;
}
« no previous file with comments | « src/pdf/SkPDFBitmap.cpp ('k') | src/pdf/SkPDFImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698