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

Unified Diff: src/pdf/SkPDFImage.cpp

Issue 23730003: [PDF] Fix image references. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | 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 6ede7aaf515d54b5155ade6f8b9ee6033eb01cec..fbd37ebd8eba82a4e76ae77c1db7f4e3a52dee6a 100644
--- a/src/pdf/SkPDFImage.cpp
+++ b/src/pdf/SkPDFImage.cpp
@@ -391,11 +391,17 @@ SkPDFImage::SkPDFImage(SkStream* stream,
bool isAlpha,
const SkIRect& srcRect,
EncodeToDCTStream encoder)
- : fBitmap(bitmap),
- fIsAlpha(isAlpha),
+ : fIsAlpha(isAlpha),
fSrcRect(srcRect),
fEncoder(encoder) {
+ if (bitmap.isImmutable()) {
+ fBitmap = bitmap;
+ } else {
+ bitmap.deepCopyTo(&fBitmap, bitmap.config());
+ fBitmap.setImmutable();
+ }
+
if (stream != NULL) {
setData(stream);
fStreamValid = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698