From 1d4af54a7b61badf2a7e6c3730b2ef01b9cd1fa2 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 16 Apr 2018 14:23:00 -0600 Subject: Don't support GrCubicEffect if float != fp32 Otherwise the cubic math is too unstable. Bug: skia: Change-Id: I2c8d8d9abcae517d42dd3eddb5bf455c7c7487dd Reviewed-on: https://skia-review.googlesource.com/121709 Reviewed-by: Greg Daniel Commit-Queue: Chris Dalton --- gm/beziereffects.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gm/beziereffects.cpp') diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp index ebcd27bb49..57caa46410 100644 --- a/gm/beziereffects.cpp +++ b/gm/beziereffects.cpp @@ -8,6 +8,7 @@ // This test only works with the GPU backend. #include "gm.h" +#include "sk_tool_utils.h" #if SK_SUPPORT_GPU @@ -135,6 +136,17 @@ protected: return; } + if (!context->caps()->shaderCaps()->floatIs32Bits()) { + SkPaint paint; + sk_tool_utils::set_portable_typeface(&paint); + paint.setAntiAlias(true); + paint.setTextSize(20); + + canvas->clear(SK_ColorWHITE); + canvas->drawString("float != fp32", 20, 40, paint); + return; + } + struct Vertex { SkPoint fPosition; float fKLM[4]; // The last value is ignored. The effect expects a vec4f. -- cgit v1.2.3