aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLinearBitmapPipeline.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-06-21 10:28:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-21 10:28:14 -0700
commitdabe5d3780dee956882c0d65c979ccd09a99ea8f (patch)
tree21f750ea8c8972806287216490dcd25f603a2b96 /src/core/SkLinearBitmapPipeline.cpp
parentdb197a54b562d92a9da2f849e780aa327e1991ca (diff)
update callers to not use SkColorProfileType
Diffstat (limited to 'src/core/SkLinearBitmapPipeline.cpp')
-rw-r--r--src/core/SkLinearBitmapPipeline.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/SkLinearBitmapPipeline.cpp b/src/core/SkLinearBitmapPipeline.cpp
index 4f6985b594..3a8606238d 100644
--- a/src/core/SkLinearBitmapPipeline.cpp
+++ b/src/core/SkLinearBitmapPipeline.cpp
@@ -567,22 +567,22 @@ private:
using Blender = SkLinearBitmapPipeline::BlendProcessorInterface;
-template <SkColorType colorType, template <SkColorType, SkColorProfileType, typename> class Sampler>
+template <SkColorType colorType, template <SkColorType, SkGammaType, typename> class Sampler>
static void choose_specific_sampler(
Blender* next,
const SkPixmap& srcPixmap,
SkLinearBitmapPipeline::SampleStage* sampleStage)
{
- if (srcPixmap.info().profileType() == kSRGB_SkColorProfileType) {
- using S = Sampler<colorType, kSRGB_SkColorProfileType, Blender>;
+ if (srcPixmap.info().gammaCloseToSRGB()) {
+ using S = Sampler<colorType, kSRGB_SkGammaType, Blender>;
sampleStage->initStage<S>(next, srcPixmap);
} else {
- using S = Sampler<colorType, kLinear_SkColorProfileType, Blender>;
+ using S = Sampler<colorType, kLinear_SkGammaType, Blender>;
sampleStage->initStage<S>(next, srcPixmap);
}
}
-template<template <SkColorType, SkColorProfileType, typename> class Sampler>
+template<template <SkColorType, SkGammaType, typename> class Sampler>
static SkLinearBitmapPipeline::SampleProcessorInterface* choose_pixel_sampler_base(
Blender* next,
const SkPixmap& srcPixmap,
@@ -592,7 +592,7 @@ static SkLinearBitmapPipeline::SampleProcessorInterface* choose_pixel_sampler_ba
const SkImageInfo& imageInfo = srcPixmap.info();
switch (imageInfo.colorType()) {
case kAlpha_8_SkColorType: {
- using S = Sampler<kAlpha_8_SkColorType, kLinear_SkColorProfileType, Blender>;
+ using S = Sampler<kAlpha_8_SkColorType, kLinear_SkGammaType, Blender>;
sampleStage->initStage<S>(next, srcPixmap, A8TintColor);
}
break;
@@ -615,7 +615,7 @@ static SkLinearBitmapPipeline::SampleProcessorInterface* choose_pixel_sampler_ba
choose_specific_sampler<kGray_8_SkColorType, Sampler>(next, srcPixmap, sampleStage);
break;
case kRGBA_F16_SkColorType: {
- using S = Sampler<kRGBA_F16_SkColorType, kLinear_SkColorProfileType, Blender>;
+ using S = Sampler<kRGBA_F16_SkColorType, kLinear_SkGammaType, Blender>;
sampleStage->initStage<S>(next, srcPixmap);
}
break;
@@ -772,8 +772,9 @@ bool SkLinearBitmapPipeline::ClonePipelineForBlitting(
if (srcPixmap.info().colorType() != kRGBA_8888_SkColorType
|| dstInfo.colorType() != kRGBA_8888_SkColorType) { return false; }
- if (srcPixmap.info().profileType() != kSRGB_SkColorProfileType
- || dstInfo.profileType() != kSRGB_SkColorProfileType) { return false; }
+ if (!srcPixmap.info().gammaCloseToSRGB() || !dstInfo.gammaCloseToSRGB()) {
+ return false;
+ }
if (xferMode != SkXfermode::kSrc_Mode && xferMode != SkXfermode::kSrcOver_Mode) {
return false;