diff options
author | 2016-04-06 07:38:23 -0700 | |
---|---|---|
committer | 2016-04-06 07:38:23 -0700 | |
commit | 898235c4864df66aa7f6d32bc2a8b8551040ce1e (patch) | |
tree | 5fb30f04825c59a970a208cabadd4bad0be283b3 /src/effects/SkMorphologyImageFilter.cpp | |
parent | 1817d282cda17cb8c2db0ac6fdc937743c026016 (diff) |
SkSurfaceProps now has a gamma-correct ("AllowSRGBInputs") flag. That's propagated in a few places so that the backend can do the right thing for L32 vs S32 mode.
Also added SkSurfaceProps to SkSpecialImage, so that Image -> Surface conversion can preserve the desired behavior during filtering.
Many small changes, including a bunch of comments about places where we may be losing information right now. My approach was to ensure that if anything fails, it will always fall back to "legacy" mode - gamma-correctness is opt-in, so I'll just have to feed things through as missing cases are exposed.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1838953007
Review URL: https://codereview.chromium.org/1845283003
Diffstat (limited to 'src/effects/SkMorphologyImageFilter.cpp')
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index ea714e59f6..616c0d2e8b 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -370,6 +370,7 @@ static void apply_morphology_rect(GrDrawContext* drawContext, float bounds[2], Gr1DKernelEffect::Direction direction) { GrPaint paint; + // SRGBTODO: AllowSRGBInputs? paint.addColorFragmentProcessor(GrMorphologyEffect::Create(texture, direction, radius, @@ -389,6 +390,7 @@ static void apply_morphology_rect_no_bounds(GrDrawContext* drawContext, GrMorphologyEffect::MorphologyType morphType, Gr1DKernelEffect::Direction direction) { GrPaint paint; + // SRGBTODO: AllowSRGBInputs? paint.addColorFragmentProcessor(GrMorphologyEffect::Create(texture, direction, radius, @@ -511,7 +513,7 @@ static sk_sp<SkSpecialImage> apply_morphology(SkSpecialImage* input, return SkSpecialImage::MakeFromGpu(input->internal_getProxy(), SkIRect::MakeWH(rect.width(), rect.height()), kNeedNewImageUniqueID_SpecialImage, - srcTexture); + srcTexture, &input->props()); } #endif @@ -619,5 +621,5 @@ sk_sp<SkSpecialImage> SkMorphologyImageFilter::onFilterImage(SkSpecialImage* sou return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), SkIRect::MakeWH(bounds.width(), bounds.height()), - dst); + dst, &source->props()); } |