OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
9 #include "Resources.h" | 9 #include "Resources.h" |
10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 if (!dstData) { | 895 if (!dstData) { |
896 return "Cannot read monitor profile. Is the resource path set correctly
?"; | 896 return "Cannot read monitor profile. Is the resource path set correctly
?"; |
897 } | 897 } |
898 | 898 |
899 switch (fMode) { | 899 switch (fMode) { |
900 case kBaseline_Mode: | 900 case kBaseline_Mode: |
901 canvas->drawBitmap(bitmap, 0, 0); | 901 canvas->drawBitmap(bitmap, 0, 0); |
902 break; | 902 break; |
903 case kDst_sRGB_Mode: | 903 case kDst_sRGB_Mode: |
904 case kDst_HPZR30w_Mode: { | 904 case kDst_HPZR30w_Mode: { |
905 sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getColorSpace()); | 905 sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getInfo().colorSpace
()); |
906 sk_sp<SkColorSpace> dstSpace = (kDst_sRGB_Mode == fMode) ? | 906 sk_sp<SkColorSpace> dstSpace = (kDst_sRGB_Mode == fMode) ? |
907 SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : | 907 SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : |
908 SkColorSpace::NewICC(dstData->data(), dstData->size()); | 908 SkColorSpace::NewICC(dstData->data(), dstData->size()); |
909 SkASSERT(dstSpace); | 909 SkASSERT(dstSpace); |
910 | 910 |
911 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(sr
cSpace, dstSpace); | 911 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(sr
cSpace, dstSpace); |
912 if (!xform) { | 912 if (!xform) { |
913 return "Unimplemented color conversion."; | 913 return "Unimplemented color conversion."; |
914 } | 914 } |
915 | 915 |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 skr.visit(i, drawsAsSingletonPictures); | 1587 skr.visit(i, drawsAsSingletonPictures); |
1588 } | 1588 } |
1589 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); | 1589 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); |
1590 | 1590 |
1591 canvas->drawPicture(macroPic); | 1591 canvas->drawPicture(macroPic); |
1592 return check_against_reference(bitmap, src, fSink); | 1592 return check_against_reference(bitmap, src, fSink); |
1593 }); | 1593 }); |
1594 } | 1594 } |
1595 | 1595 |
1596 } // namespace DM | 1596 } // namespace DM |
OLD | NEW |