Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 60b69ec

Browse files
Mike KleinSkia Commit-Bot
authored andcommitted
clarify that there's no kMedium here
Reword to make it clearer we're only handling kNone, kLow, and kHigh; kMedium has been transformed into kLow or kHigh already at this point. I think it's particularly easy to be confused by the line if (quality > kLow_SkFilterQuality) { ... } Change-Id: If78cb6e946e26d08f5acd807d32e0446c69061b1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261765 Auto-Submit: Mike Klein <mtklein@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
1 parent 4311f19 commit 60b69ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shaders/SkImageShader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ bool SkImageShader::doStages(const SkStageRec& rec, SkImageStageUpdater* updater
499499
bool src_is_normalized = SkColorTypeIsNormalized(info.colorType());
500500

501501
// Bicubic filtering naturally produces out of range values on both sides of [0,1].
502-
if (quality > kLow_SkFilterQuality) {
502+
if (quality == kHigh_SkFilterQuality) {
503503
p->append(SkRasterPipeline::clamp_0);
504504
p->append(fClampAsIfUnpremul ? SkRasterPipeline::clamp_1
505505
: SkRasterPipeline::clamp_a);
@@ -597,6 +597,7 @@ bool SkImageShader::doStages(const SkStageRec& rec, SkImageStageUpdater* updater
597597
p->append(SkRasterPipeline::move_dst_src);
598598

599599
} else {
600+
SkASSERT(quality == kHigh_SkFilterQuality);
600601
p->append(SkRasterPipeline::save_xy, sampler);
601602

602603
sample(SkRasterPipeline::bicubic_n3x, SkRasterPipeline::bicubic_n3y);

0 commit comments

Comments
 (0)