diff options
author | Brian Osman <brianosman@google.com> | 2018-07-10 15:50:11 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-10 20:14:05 +0000 |
commit | c69c4410be7def8fa129496de994d83c497f06db (patch) | |
tree | f45a03423238d72fb4ff787e74b5e75e85d92639 /gm | |
parent | b82edcc92bb49ca877bd51b9f47cfece68785035 (diff) |
Remove matrixconvolution GM hacks for linear blending
GMs now match betwen gl and glsrgb
Change-Id: Ibc6acf29d93d8bfab81a14be5d794d6e24844324
Reviewed-on: https://skia-review.googlesource.com/140346
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/matrixconvolution.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/gm/matrixconvolution.cpp b/gm/matrixconvolution.cpp index adb7eceff0..813a1f9a8a 100644 --- a/gm/matrixconvolution.cpp +++ b/gm/matrixconvolution.cpp @@ -31,9 +31,8 @@ protected: void makeBitmap() { // Draw our bitmap in N32, so legacy devices get "premul" values they understand - SkBitmap n32Bitmap; - n32Bitmap.allocN32Pixels(80, 80); - SkCanvas canvas(n32Bitmap); + fBitmap.allocN32Pixels(80, 80); + SkCanvas canvas(fBitmap); canvas.clear(0x00000000); SkPaint paint; paint.setAntiAlias(true); @@ -47,10 +46,6 @@ protected: pts, fColors, pos, 2, SkShader::kClamp_TileMode)); const char* str = "e"; canvas.drawString(str, SkIntToScalar(-10), SkIntToScalar(80), paint); - - // ... tag the data as sRGB, so color-aware devices do gamut adjustment, etc... - fBitmap.setInfo(SkImageInfo::MakeS32(80, 80, kPremul_SkAlphaType)); - fBitmap.setPixelRef(sk_ref_sp(n32Bitmap.pixelRef()), 0, 0); } SkISize onISize() override { @@ -67,19 +62,6 @@ protected: }; SkISize kernelSize = SkISize::Make(3, 3); SkScalar gain = 0.3f, bias = SkIntToScalar(100); - if (canvas->imageInfo().colorSpace()) { - // TODO: Gain and bias are poorly specified (in the feConvolveMatrix SVG documentation, - // there is obviously no mention of gamma or color spaces). Eventually, we need to - // decide what to do with these (they generally have an extreme brightening effect). - // For now, I'm modifying this GM to use values tuned to preserve luminance across the - // range of input values (compared to the legacy math and values). - // - // It's impossible to match the results exactly, because legacy math produces a flat - // response (when looking at sRGB encoded results), while gamma-correct math produces - // a curve. - gain = 0.25f; - bias = 16.5f; - } SkPaint paint; paint.setImageFilter(SkMatrixConvolutionImageFilter::Make(kernelSize, kernel, |