Fix caching of sample locations
The original caching logic for sample locations wishfully assumed that
the GPU would always use the same sample pattern for render targets
that had the same number of samples. It turns out we can't rely on
that. This change improves the caching logic to handle mismatched
simple patterns with the same count, and adds a unit test that
emulates different sample patterns observed on real hardware.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111423002
Committed: https://skia.googlesource.com/skia/+/09d49a3bfe2d1e652a648ce1ea0962b38d10d166
Review-Url: https://codereview.chromium.org/2111423002
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index 97a9c49..83ab4ea 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -294,10 +294,8 @@
const SkIRect& srcRect,
const SkIPoint& dstPoint) override { return false; };
- void onGetMultisampleSpecs(GrRenderTarget* rt,
- const GrStencilSettings&,
- int* effectiveSampleCnt,
- SkAutoTDeleteArray<SkPoint>*) override {
+ void onGetMultisampleSpecs(GrRenderTarget* rt, const GrStencilSettings&,
+ int* effectiveSampleCnt, SamplePattern*) override {
*effectiveSampleCnt = rt->desc().fSampleCnt;
}