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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 2170793004: Remove unnecessary getColorSpace() API from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass refs more efficiently Created 4 years, 5 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 | « bench/ColorCodecBench.cpp ('k') | include/codec/SkCodec.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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | include/codec/SkCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698