aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/beziereffects.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-04-16 14:23:00 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-16 22:50:45 +0000
commit1d4af54a7b61badf2a7e6c3730b2ef01b9cd1fa2 (patch)
tree9892e21b7451034bfde1126013e8c497cc202418 /gm/beziereffects.cpp
parent37c5403890000289d7db9fd1d90cf96c2ee12bf3 (diff)
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 <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'gm/beziereffects.cpp')
-rw-r--r--gm/beziereffects.cpp12
1 files changed, 12 insertions, 0 deletions
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.