OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 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 | 8 |
9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
10 #include "SkImageEncoder.h" | 10 #include "SkImageEncoder.h" |
11 #include "SkJpegUtility.h" | 11 #include "SkJpegUtility.h" |
12 #include "SkColorPriv.h" | 12 #include "SkColorPriv.h" |
13 #include "SkDither.h" | 13 #include "SkDither.h" |
| 14 #include "SkMSAN.h" |
14 #include "SkScaledBitmapSampler.h" | 15 #include "SkScaledBitmapSampler.h" |
15 #include "SkStream.h" | 16 #include "SkStream.h" |
16 #include "SkTemplates.h" | 17 #include "SkTemplates.h" |
17 #include "SkTime.h" | 18 #include "SkTime.h" |
18 #include "SkUtils.h" | 19 #include "SkUtils.h" |
19 #include "SkRTConf.h" | 20 #include "SkRTConf.h" |
20 #include "SkRect.h" | 21 #include "SkRect.h" |
21 #include "SkCanvas.h" | 22 #include "SkCanvas.h" |
22 | 23 |
23 | 24 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 return kPartialSuccess; | 518 return kPartialSuccess; |
518 } | 519 } |
519 if (this->shouldCancelDecode()) { | 520 if (this->shouldCancelDecode()) { |
520 return return_failure(cinfo, *bm, "shouldCancelDecode"); | 521 return return_failure(cinfo, *bm, "shouldCancelDecode"); |
521 } | 522 } |
522 | 523 |
523 if (JCS_CMYK == cinfo.out_color_space) { | 524 if (JCS_CMYK == cinfo.out_color_space) { |
524 convert_CMYK_to_RGB(srcRow, cinfo.output_width); | 525 convert_CMYK_to_RGB(srcRow, cinfo.output_width); |
525 } | 526 } |
526 | 527 |
| 528 sk_msan_mark_initialized(srcRow, srcRow + cinfo.output_width * srcBytesP
erPixel, |
| 529 "skbug.com/4550"); |
| 530 |
527 sampler.next(srcRow); | 531 sampler.next(srcRow); |
528 if (bm->height() - 1 == y) { | 532 if (bm->height() - 1 == y) { |
529 // we're done | 533 // we're done |
530 break; | 534 break; |
531 } | 535 } |
532 | 536 |
533 if (!skip_src_rows(&cinfo, srcRow, sampler.srcDY() - 1)) { | 537 if (!skip_src_rows(&cinfo, srcRow, sampler.srcDY() - 1)) { |
534 return return_failure(cinfo, *bm, "skip rows"); | 538 return return_failure(cinfo, *bm, "skip rows"); |
535 } | 539 } |
536 } | 540 } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 return SkImageDecoder::kUnknown_Format; | 1028 return SkImageDecoder::kUnknown_Format; |
1025 } | 1029 } |
1026 | 1030 |
1027 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { | 1031 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { |
1028 return (SkImageEncoder::kJPEG_Type == t) ? new SkJPEGImageEncoder : nullptr; | 1032 return (SkImageEncoder::kJPEG_Type == t) ? new SkJPEGImageEncoder : nullptr; |
1029 } | 1033 } |
1030 | 1034 |
1031 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); | 1035 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); |
1032 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); | 1036 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); |
1033 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); | 1037 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); |
OLD | NEW |