From c8f969309cafebeb16ad057f766b61bdc406a8b8 Mon Sep 17 00:00:00 2001 From: scroggo Date: Wed, 16 Dec 2015 14:17:58 -0800 Subject: Revert of Add test for previously unflattenables (patchset #1 id:1 of https://codereview.chromium.org/1514373003/ ) Reason for revert: Speculative fix for skbug.com/4709 Original issue's description: > Add test for previously unflattenables > > BUG=skia:4613 > > Committed: https://skia.googlesource.com/skia/+/061aaa79f7d8a2e93962e8296abaae13f0a7a715 TBR=halcanary@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4613 Review URL: https://codereview.chromium.org/1532753002 --- tests/FlattenableFactoryToName.cpp | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 tests/FlattenableFactoryToName.cpp (limited to 'tests/FlattenableFactoryToName.cpp') diff --git a/tests/FlattenableFactoryToName.cpp b/tests/FlattenableFactoryToName.cpp deleted file mode 100644 index f8cb4fa2f9..0000000000 --- a/tests/FlattenableFactoryToName.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2015 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkAlphaThresholdFilter.h" -#include "SkImage.h" -#include "Test.h" - -static void test_flattenable(skiatest::Reporter* r, - const SkFlattenable* f, - const char* desc) { - if (f) { - SkFlattenable::Factory factory = f->getFactory(); - REPORTER_ASSERT(r, factory); - if (factory) { - if (!SkFlattenable::FactoryToName(factory)) { - ERRORF(r, "SkFlattenable::FactoryToName() fails with %s.", desc); - } - } - } -} - -DEF_TEST(FlattenableFactoryToName, r) { - SkIRect rects[2]; - rects[0] = SkIRect::MakeXYWH(0, 150, 500, 200); - rects[1] = SkIRect::MakeXYWH(150, 0, 200, 500); - SkRegion region; - region.setRects(rects, 2); - SkAutoTUnref filter( SkAlphaThresholdFilter::Create(region, 0.2f, 0.7f)); - test_flattenable(r, filter, "SkAlphaThresholdFilter()"); - - SkBitmap bm; - bm.allocN32Pixels(8, 8); - bm.eraseColor(SK_ColorCYAN); - SkAutoTUnref image(SkImage::NewFromBitmap(bm)); - SkAutoTUnref shader(image->newShader(SkShader::kClamp_TileMode, - SkShader::kClamp_TileMode)); - test_flattenable(r, shader, "SkImage::newShader()"); -} -- cgit v1.2.3