Update new blurrect_compare GM to skip when SkCanvas::makeSurface will fail

Change-Id: I6e101bf54e233345934e258dadb4fb7ab3283b61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240511
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Brian Salomon 2019-09-10 13:37:23 -04:00 committed by Skia Commit-Bot
parent a8f43ce668
commit 78be3ebee7

View File

@ -251,7 +251,11 @@ protected:
void onOnceBeforeDraw() override { this->prepareReferenceMasks(); }
void onDraw(SkCanvas* canvas) override {
DrawResult onDraw(SkCanvas* canvas, SkString* errorMsg) override {
if (canvas->imageInfo().colorType() == kUnknown_SkColorType) {
*errorMsg = "Not supported when recording, relies on canvas->makeSurface()";
return DrawResult::kSkip;
}
int32_t ctxID = canvas->getGrContext() ? canvas->getGrContext()->priv().contextID() : 0;
if (fRecalcMasksForAnimation || !fActualMasks[0][0][0] || ctxID != fLastContextUniqueID) {
if (fRecalcMasksForAnimation) {
@ -316,6 +320,7 @@ protected:
canvas->restore();
canvas->translate(totalW + 2 * kMargin, 0);
}
return DrawResult::kOk;
}
bool onAnimate(double nanos) override {
fSigmaAnimationBoost = TimeUtils::SineWave(nanos, 5, 2.5f, 0.f, 2.f);