Add new virts, hide old ones
Add virtuals for the draw methods that now take sampling/filtermode.
drawImage
drawImageRect
drawImageLattice
drawAtlas
Add a flag that can remove the older virtuals, once each client has
stopped overriding them. In that situation, the older public methods
will simplify extract the sampling from the paint, and call the new
public methods.
Bug: skia:11105, skia:7650
Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/samplecode/SampleAnimatedText.cpp b/samplecode/SampleAnimatedText.cpp
index f9bd925..80aafdc 100644
--- a/samplecode/SampleAnimatedText.cpp
+++ b/samplecode/SampleAnimatedText.cpp
@@ -73,7 +73,8 @@
sk_sp<SkImage> image = direct->priv().testingOnly_getFontAtlasImage(
GrMaskFormat::kA8_GrMaskFormat);
const SkRect rect = SkRect::MakeXYWH(512.0f, 10.0f, 512.0f, 512.0f);
- canvas->drawImageRect(image.get(), rect, rect, sampling, &paint);
+ canvas->drawImageRect(image.get(), rect, rect, sampling, &paint,
+ SkCanvas::kFast_SrcRectConstraint);
}
#endif
canvas->translate(180, 180);
diff --git a/samplecode/SampleFilterBounds.cpp b/samplecode/SampleFilterBounds.cpp
index bebdcc2..d9d699d 100644
--- a/samplecode/SampleFilterBounds.cpp
+++ b/samplecode/SampleFilterBounds.cpp
@@ -184,7 +184,7 @@
canvas->saveLayer(&localContentRect, &blurPaint);
canvas->drawImageRect(fImage.get(), localContentRect, localContentRect,
SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kNone),
- nullptr);
+ nullptr, SkCanvas::kFast_SrcRectConstraint);
canvas->restore();
// Now visualize the underlying bounds calculations used to determine the layer for the blur
diff --git a/samplecode/SampleThinAA.cpp b/samplecode/SampleThinAA.cpp
index 08b2b44..97be844 100644
--- a/samplecode/SampleThinAA.cpp
+++ b/samplecode/SampleThinAA.cpp
@@ -226,7 +226,8 @@
SkRect::MakeWH(kTileWidth, kTileHeight),
SkSamplingOptions(scale > 1.f ? kNone_SkFilterQuality
: kMedium_SkFilterQuality),
- &blit);
+ &blit,
+ SkCanvas::kFast_SrcRectConstraint);
}
private: