Commit a2a7e93a authored by Mike Reed's avatar Mike Reed Committed by Chromium LUCI CQ

Opt into new bicubic behavior

Skia now supports explicit controls over the sampling technique:
- filtering: nearest, linear, cubic (only works with mipmaps:none)
- mipmaps: none, nearest, linear (allows trilerp)

See SkSamplingOptions.h

Switching to these means skia no longer "changes" the technique based on
heuristics (like the direction of the scaling): you always get what you
ask for (more predictable).

Need to rebaseline tests, as sometimes (e.g.) Skia used to treat
"High Qualitty" (ala bicubic) as just bilinear when downscaling.

The SkFilterQuality enum is deprecated: it is mapped as follows:

kNone.  : [ filter:nearest, mipmap:none    ]
kLow    : [ filter:linear,  mipmap:none    ]
kMedium : [ filter:linear,  mipmap:nearest ]
kHigh   : [ filter:cubic,   mipmap:none    ]

You can now specify these directly when you create an ImageShader.
Specifying the enum in SkPaint is depcrecated, and will be removed.

Bug: skia:7650
Change-Id: I5251b195fbc8ff7e71d3aa76fdc3dde139a35c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2562751
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832543}
parent 9ad2fb4b
......@@ -229,10 +229,6 @@ SK_API void SkDebugf_FileLine(const char* file,
#define GR_OP_ALLOCATE_USE_NEW
#endif
#ifndef SK_SUPPORT_LEGACY_ADJUSTHQHEURISTIC
#define SK_SUPPORT_LEGACY_ADJUSTHQHEURISTIC
#endif
// Staging for lowp::bilerp_clamp_8888, and for planned misc. others.
#define SK_DISABLE_LOWP_BILERP_CLAMP_CLAMP_STAGE
......
......@@ -75,7 +75,6 @@ test(function(t) {
// No filtering uses kNone quality, while with imageSmoothingEnabled we use the
// same quality.
assert_false(noFilterData === mediumData);
assert_true(mediumData === highData);
// On setting, it must be set to the new value.
highContext.imageSmoothingQuality = 'medium';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment