aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GradientTest.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-06-07 15:03:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-07 20:24:51 +0000
commitd1aeddeb8aa2d678a24511542935f1f33c2eebcd (patch)
tree356021eff018fce6c9071331ba8dff565f9e17ae /tests/GradientTest.cpp
parentdb6365a9e267192c02d2745a654b07888f76b32e (diff)
Remove SkLinearGradient::kForce4fContext_PrivateFlag
... and related tests/gms. We now exercise the 4f impl with raster-pipeline/burst, no need for a special test flag. Change-Id: If67684d2d8840b3c413db9eeebb051f59cbc5a34 Reviewed-on: https://skia-review.googlesource.com/19025 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'tests/GradientTest.cpp')
-rw-r--r--tests/GradientTest.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/GradientTest.cpp b/tests/GradientTest.cpp
index 732bfbc22b..3c62cb9d62 100644
--- a/tests/GradientTest.cpp
+++ b/tests/GradientTest.cpp
@@ -9,7 +9,6 @@
#include "SkColorPriv.h"
#include "SkColorShader.h"
#include "SkGradientShader.h"
-#include "SkLinearGradient.h"
#include "SkShader.h"
#include "SkSurface.h"
#include "SkTemplates.h"
@@ -446,13 +445,22 @@ static void test_linear_fuzzer(skiatest::Reporter*) {
},
};
- static const uint32_t gForceFlags[] = { 0, SkLinearGradient::kForce4fContext_PrivateFlag };
+ sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
+ SkColorSpace* colorSpaces[] = {
+ nullptr, // hits the legacy gradient impl
+ srgb.get(), // triggers 4f/raster-pipeline
+ };
- sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(100, 100);
- SkCanvas* canvas = surface->getCanvas();
SkPaint paint;
- for (auto forceFlags : gForceFlags) {
+ for (auto colorSpace : colorSpaces) {
+
+ sk_sp<SkSurface> surface = SkSurface::MakeRaster(SkImageInfo::Make(100, 100,
+ kN32_SkColorType,
+ kPremul_SkAlphaType,
+ sk_ref_sp(colorSpace)));
+ SkCanvas* canvas = surface->getCanvas();
+
for (const auto& config : gConfigs) {
SkAutoCanvasRestore acr(canvas, false);
SkTLazy<SkMatrix> localMatrix;
@@ -466,7 +474,7 @@ static void test_linear_fuzzer(skiatest::Reporter*) {
config.fPos,
config.fCount,
config.fTileMode,
- config.fFlags | forceFlags,
+ config.fFlags,
localMatrix.getMaybeNull()));
if (config.fGlobalMatrix) {
SkMatrix m;