aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFBitmap.cpp5
-rw-r--r--src/pdf/SkPDFDevice.cpp6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 2d789d04d8..ea6887ac80 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -17,7 +17,7 @@
#include "SkUnPreMultiply.h"
void image_get_ro_pixels(const SkImage* image, SkBitmap* dst) {
- if(as_IB(image)->getROPixels(dst)
+ if(as_IB(image)->getROPixels(dst, SkDestinationSurfaceColorMode::kLegacy)
&& dst->dimensions() == image->dimensions()) {
if (dst->colorType() != kIndex_8_SkColorType) {
return;
@@ -502,7 +502,8 @@ sk_sp<SkPDFObject> SkPDFCreateBitmapObject(sk_sp<SkImage> image,
if (pixelSerializer) {
SkBitmap bm;
SkAutoPixmapUnlock apu;
- if (as_IB(image.get())->getROPixels(&bm) && bm.requestLock(&apu)) {
+ if (as_IB(image.get())->getROPixels(&bm, SkDestinationSurfaceColorMode::kLegacy) &&
+ bm.requestLock(&apu)) {
data.reset(pixelSerializer->encode(apu.pixmap()));
if (data && SkIsJFIF(data.get(), &info)) {
bool yuv = info.fType == SkJFIFInfo::kYCbCr;
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index a04b380005..9a70f68c31 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -2315,8 +2315,12 @@ sk_sp<SkSpecialImage> SkPDFDevice::makeSpecial(const SkBitmap& bitmap) {
}
sk_sp<SkSpecialImage> SkPDFDevice::makeSpecial(const SkImage* image) {
+ // TODO: See comment above in drawSpecial. The color mode we use for decode should be driven
+ // by the destination where we're going to draw thing thing (ie this device). But we don't have
+ // a color space, so we always decode in legacy mode for now.
return SkSpecialImage::MakeFromImage(SkIRect::MakeWH(image->width(), image->height()),
- image->makeNonTextureImage());
+ image->makeNonTextureImage(),
+ SkDestinationSurfaceColorMode::kLegacy);
}
sk_sp<SkSpecialImage> SkPDFDevice::snapSpecial() {