| OLD | NEW |
| 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 bool isAlpha, | 500 bool isAlpha, |
| 501 const SkIRect& srcRect, | 501 const SkIRect& srcRect, |
| 502 SkPicture::EncodeBitmap encoder) | 502 SkPicture::EncodeBitmap encoder) |
| 503 : fIsAlpha(isAlpha), | 503 : fIsAlpha(isAlpha), |
| 504 fSrcRect(srcRect), | 504 fSrcRect(srcRect), |
| 505 fEncoder(encoder) { | 505 fEncoder(encoder) { |
| 506 | 506 |
| 507 if (bitmap.isImmutable()) { | 507 if (bitmap.isImmutable()) { |
| 508 fBitmap = bitmap; | 508 fBitmap = bitmap; |
| 509 } else { | 509 } else { |
| 510 bitmap.deepCopyTo(&fBitmap, bitmap.config()); | 510 bitmap.deepCopyTo(&fBitmap); |
| 511 fBitmap.setImmutable(); | 511 fBitmap.setImmutable(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 if (stream != NULL) { | 514 if (stream != NULL) { |
| 515 setData(stream); | 515 setData(stream); |
| 516 fStreamValid = true; | 516 fStreamValid = true; |
| 517 } else { | 517 } else { |
| 518 fStreamValid = false; | 518 fStreamValid = false; |
| 519 } | 519 } |
| 520 | 520 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 // but the new catalog wants it compressed. | 626 // but the new catalog wants it compressed. |
| 627 if (!getSubstitute()) { | 627 if (!getSubstitute()) { |
| 628 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this)); | 628 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this)); |
| 629 setSubstitute(substitute); | 629 setSubstitute(substitute); |
| 630 catalog->setSubstitute(this, substitute); | 630 catalog->setSubstitute(this, substitute); |
| 631 } | 631 } |
| 632 return false; | 632 return false; |
| 633 } | 633 } |
| 634 return true; | 634 return true; |
| 635 } | 635 } |
| OLD | NEW |