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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 2078623002: Support sRGB dsts in opt code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Drop parens Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « dm/DMSrcSink.h ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 sk_sp<SkData> dstData = SkData::MakeFromFileName( 879 sk_sp<SkData> dstData = SkData::MakeFromFileName(
880 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str()); 880 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str());
881 if (!dstData) { 881 if (!dstData) {
882 return "Cannot read monitor profile. Is the resource path set correctly ?"; 882 return "Cannot read monitor profile. Is the resource path set correctly ?";
883 } 883 }
884 884
885 switch (fMode) { 885 switch (fMode) {
886 case kBaseline_Mode: 886 case kBaseline_Mode:
887 canvas->drawBitmap(bitmap, 0, 0); 887 canvas->drawBitmap(bitmap, 0, 0);
888 break; 888 break;
889 case kDst_sRGB_Mode:
889 case kDst_HPZR30w_Mode: { 890 case kDst_HPZR30w_Mode: {
890 sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getColorSpace()); 891 sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getColorSpace());
891 sk_sp<SkColorSpace> dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); 892 sk_sp<SkColorSpace> dstSpace = (kDst_sRGB_Mode == fMode) ?
893 SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) :
894 SkColorSpace::NewICC(dstData->data(), dstData->size());
892 SkASSERT(dstSpace); 895 SkASSERT(dstSpace);
893 896
894 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(sr cSpace, dstSpace); 897 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(sr cSpace, dstSpace);
895 if (!xform) { 898 if (!xform) {
896 // FIXME (msarett): 899 // FIXME (msarett):
897 // I haven't implemented conversions for all of the images that I've uploaded for 900 // I haven't implemented conversions for all of the images that I've uploaded for
898 // testing. Once we support all of them, this should be a fatal error. 901 // testing. Once we support all of them, this should be a fatal error.
899 return Error::Nonfatal("Unimplemented color conversion."); 902 return Error::Nonfatal("Unimplemented color conversion.");
900 } 903 }
901 904
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 skr.visit(i, drawsAsSingletonPictures); 1546 skr.visit(i, drawsAsSingletonPictures);
1544 } 1547 }
1545 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); 1548 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture());
1546 1549
1547 canvas->drawPicture(macroPic); 1550 canvas->drawPicture(macroPic);
1548 return check_against_reference(bitmap, src, fSink); 1551 return check_against_reference(bitmap, src, fSink);
1549 }); 1552 });
1550 } 1553 }
1551 1554
1552 } // namespace DM 1555 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMSrcSink.h ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698