From b0355a764315d68cae85e344a54e27feabf972c6 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Tue, 25 May 2021 23:49:39 -0600 Subject: [PATCH] Fix trickycubicstrokes and widebuttcaps bg colors on GpuTess Setting the max tessellation segments to 5 for GpuTess caused some of these backgrounds to incorrectly show up as red. Change-Id: Ie6b7b44e5500e1dd23df2e7f6b3783bcabcc614d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412556 Reviewed-by: Brian Salomon Commit-Queue: Chris Dalton --- gm/trickycubicstrokes.cpp | 6 +++--- gm/widebuttcaps.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gm/trickycubicstrokes.cpp b/gm/trickycubicstrokes.cpp index f9d356d250..5d89f67773 100644 --- a/gm/trickycubicstrokes.cpp +++ b/gm/trickycubicstrokes.cpp @@ -104,9 +104,9 @@ static void draw_test(SkCanvas* canvas, SkPaint::Cap cap, SkPaint::Join join) { if (canvas->recordingContext() && canvas->recordingContext()->priv().caps()->shaderCaps()->tessellationSupport() && - canvas->recordingContext()->priv().caps()->shaderCaps()->maxTessellationSegments() < 64) { - // There are fewer tessellation segments than the spec minimum. It must have been overriden - // for testing. Indicate this in the background color. + canvas->recordingContext()->priv().caps()->shaderCaps()->maxTessellationSegments() == 5) { + // The caller successfully overrode the max tessellation segments to 5. Indicate this in the + // background color. canvas->clear(SkColorSetARGB(255, 64, 0, 0)); } else { canvas->clear(SK_ColorBLACK); diff --git a/gm/widebuttcaps.cpp b/gm/widebuttcaps.cpp index dca767f90e..1629a72289 100644 --- a/gm/widebuttcaps.cpp +++ b/gm/widebuttcaps.cpp @@ -51,9 +51,9 @@ static void draw_test(SkCanvas* canvas) { if (canvas->recordingContext() && canvas->recordingContext()->priv().caps()->shaderCaps()->tessellationSupport() && - canvas->recordingContext()->priv().caps()->shaderCaps()->maxTessellationSegments() < 64) { - // There are fewer tessellation segments than the spec minimum. It must have been overriden - // for testing. Indicate this in the background color. + canvas->recordingContext()->priv().caps()->shaderCaps()->maxTessellationSegments() == 5) { + // The caller successfully overrode the max tessellation segments to 5. Indicate this in the + // background color. canvas->clear(SkColorSetARGB(255, 64, 0, 0)); } else { canvas->clear(SK_ColorBLACK);