diff options
author | Brian Osman <brianosman@google.com> | 2017-12-12 14:09:31 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-12 19:34:29 +0000 |
commit | 36703d9d368050a20764b5336534bd718fd00a6e (patch) | |
tree | c452daef0a4d61f6550741cf79d2ee4c755750c2 /dm | |
parent | 09757b29feeb1e7a4bc73dcf07c960e06f20cd66 (diff) |
Push much of the SkColorSpace_Base interface up to SkColorSpace
Some pieces still remain, but the next step looks less mechanical,
so I wanted to land this piece independently.
Bug: skia:
Change-Id: Ie63afcfa08af2f6e4996911fa2225c43441dbfb2
Reviewed-on: https://skia-review.googlesource.com/84120
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 2 | ||||
-rw-r--r-- | dm/DMSrcSink.cpp | 7 |
2 files changed, 3 insertions, 6 deletions
@@ -919,7 +919,7 @@ static sk_sp<SkColorSpace> adobe_rgb() { } static sk_sp<SkColorSpace> rgb_to_gbr() { - return as_CSB(SkColorSpace::MakeSRGB())->makeColorSpin(); + return SkColorSpace::MakeSRGB()->makeColorSpin(); } static Sink* create_via(const SkString& tag, Sink* wrapped) { diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 96817e0749..a43f8d1906 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -385,8 +385,7 @@ static bool get_decode_info(SkImageInfo* decodeInfo, SkColorType canvasColorType } if (kRGBA_F16_SkColorType == canvasColorType) { - sk_sp<SkColorSpace> linearSpace = - as_CSB(decodeInfo->colorSpace())->makeLinearGamma(); + sk_sp<SkColorSpace> linearSpace = decodeInfo->colorSpace()->makeLinearGamma(); *decodeInfo = decodeInfo->makeColorSpace(std::move(linearSpace)); } @@ -1083,9 +1082,7 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const { decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); } if (kRGBA_F16_SkColorType == fColorType) { - SkASSERT(SkColorSpace_Base::Type::kXYZ == as_CSB(decodeInfo.colorSpace())->type()); - SkColorSpace_XYZ* csXYZ = static_cast<SkColorSpace_XYZ*>(decodeInfo.colorSpace()); - decodeInfo = decodeInfo.makeColorSpace(csXYZ->makeLinearGamma()); + decodeInfo = decodeInfo.makeColorSpace(decodeInfo.colorSpace()->makeLinearGamma()); } SkImageInfo bitmapInfo = decodeInfo; |