diff options
author | bsalomon <bsalomon@google.com> | 2016-03-30 18:56:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-30 18:56:20 -0700 |
commit | 3724e574a744491b7cfb8187ac865a70ef3d4528 (patch) | |
tree | eb3dd729cbc0adef5ce2b4a2fa048fe21baeb35a /tests | |
parent | 2238c9dbca4b791edc512957728a18ce14d55912 (diff) |
Move SkGLContext and some GrGLInterface implementations to skgputest module
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815823002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Committed: https://skia.googlesource.com/skia/+/fe3456cb006110d045b26ff3f8681b893a757b58
Review URL: https://codereview.chromium.org/1815823002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/EGLImageTest.cpp | 8 | ||||
-rw-r--r-- | tests/GLProgramsTest.cpp | 2 | ||||
-rw-r--r-- | tests/GrContextFactoryTest.cpp | 2 | ||||
-rw-r--r-- | tests/GrPorterDuffTest.cpp | 4 | ||||
-rw-r--r-- | tests/ImageTest.cpp | 2 | ||||
-rw-r--r-- | tests/RectangleTextureTest.cpp | 2 | ||||
-rw-r--r-- | tests/Test.h | 32 | ||||
-rw-r--r-- | tests/TestConfigParsing.cpp | 2 | ||||
-rw-r--r-- | tests/TestTest.cpp | 4 | ||||
-rw-r--r-- | tests/TextureStorageAllocator.cpp | 2 | ||||
-rw-r--r-- | tests/skia_test.cpp | 1 |
11 files changed, 36 insertions, 25 deletions
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp index f19592c530..7f0d7ea376 100644 --- a/tests/EGLImageTest.cpp +++ b/tests/EGLImageTest.cpp @@ -11,9 +11,11 @@ #include "GrContextFactory.h" #include "gl/GrGLGpu.h" #include "gl/GrGLUtil.h" -#include "gl/SkGLContext.h" +#include "gl/GLContext.h" -static void cleanup(SkGLContext* glctx0, GrGLuint texID0, SkGLContext* glctx1, GrContext* grctx1, +using sk_gpu_test::GLContext; + +static void cleanup(GLContext* glctx0, GrGLuint texID0, GLContext* glctx1, GrContext* grctx1, const GrGLTextureInfo* grbackendtex1, GrEGLImage image1) { if (glctx1) { glctx1->makeCurrent(); @@ -91,7 +93,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(EGLImageTest, reporter, context0, glCtx0) { return; } - SkAutoTDelete<SkGLContext> glCtx1 = glCtx0->createNew(); + SkAutoTDelete<GLContext> glCtx1 = glCtx0->createNew(); if (!glCtx1) { return; } diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 03938fbb93..57274e0678 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -455,7 +455,7 @@ DEF_GPUTEST(GLPrograms, reporter, /*factory*/) { // We suppress prints to avoid spew GrContextOptions opts; opts.fSuppressPrints = true; - GrContextFactory debugFactory(opts); + sk_gpu_test::GrContextFactory debugFactory(opts); skiatest::RunWithGPUTestContexts(test_glprograms_native, skiatest::kNative_GPUTestContexts, reporter, &debugFactory); skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp index 800b18cce0..bd1888380a 100644 --- a/tests/GrContextFactoryTest.cpp +++ b/tests/GrContextFactoryTest.cpp @@ -13,6 +13,8 @@ #include "GrCaps.h" #include "Test.h" +using sk_gpu_test::GrContextFactory; + DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter, /*factory*/) { // Test that if NVPR is requested, the context always has path rendering // or the context creation fails. diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index 54fcfc1d42..566ec12f5d 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -1147,8 +1147,8 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, /*factory*/) { GrContextOptions opts; opts.fSuppressDualSourceBlending = true; - GrContextFactory mockFactory(opts); - GrContext* ctx = mockFactory.get(GrContextFactory::kNull_GLContextType); + sk_gpu_test::GrContextFactory mockFactory(opts); + GrContext* ctx = mockFactory.get(sk_gpu_test::GrContextFactory::kNull_GLContextType); if (!ctx) { SkFAIL("Failed to create null context without ARB_blend_func_extended."); return; diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index 15ee54c000..8485fdad68 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -26,6 +26,8 @@ #include "SkUtils.h" #include "Test.h" +using sk_gpu_test::GrContextFactory; + static void assert_equal(skiatest::Reporter* reporter, SkImage* a, const SkIRect* subsetA, SkImage* b) { const int widthA = subsetA ? subsetA->width() : a->width(); diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index 114207d2fe..fc9e65e12d 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -11,7 +11,7 @@ #include "GrDrawContext.h" #include "gl/GrGLGpu.h" #include "gl/GrGLUtil.h" -#include "gl/SkGLContext.h" +#include "gl/GLContext.h" static void test_read_pixels(skiatest::Reporter* reporter, GrContext* context, GrTexture* rectangleTexture, uint32_t expectedPixelValues[]) { diff --git a/tests/Test.h b/tests/Test.h index 4b19a85c1d..119976f3ee 100644 --- a/tests/Test.h +++ b/tests/Test.h @@ -11,9 +11,11 @@ #include "SkTRegistry.h" #include "SkTypes.h" +namespace sk_gpu_test { class GrContextFactory; +class GLContext; +} // namespace sk_gpu_test class GrContext; -class SkGLContext; namespace skiatest { @@ -41,7 +43,7 @@ public: #define REPORT_FAILURE(reporter, cond, message) \ reporter->reportFailed(skiatest::Failure(__FILE__, __LINE__, cond, message)) -typedef void (*TestProc)(skiatest::Reporter*, GrContextFactory*); +typedef void (*TestProc)(skiatest::Reporter*, sk_gpu_test::GrContextFactory*); struct Test { Test(const char* n, bool g, TestProc p) : name(n), needsGpu(g), proc(p) {} @@ -83,7 +85,7 @@ enum GPUTestContexts { }; template<typename T> void RunWithGPUTestContexts(T testFunction, GPUTestContexts contexts, Reporter* reporter, - GrContextFactory* factory); + sk_gpu_test::GrContextFactory* factory); /** Timer provides wall-clock duration since its creation. */ class Timer { @@ -133,32 +135,32 @@ private: } \ } while (0) -#define DEF_TEST(name, reporter) \ - static void test_##name(skiatest::Reporter*, GrContextFactory*); \ - skiatest::TestRegistry name##TestRegistry( \ - skiatest::Test(#name, false, test_##name)); \ - void test_##name(skiatest::Reporter* reporter, GrContextFactory*) +#define DEF_TEST(name, reporter) \ + static void test_##name(skiatest::Reporter*, sk_gpu_test::GrContextFactory*); \ + skiatest::TestRegistry name##TestRegistry( \ + skiatest::Test(#name, false, test_##name)); \ + void test_##name(skiatest::Reporter* reporter, sk_gpu_test::GrContextFactory*) #define GPUTEST_EXPAND_MSVC(x) x #define GPUTEST_APPLY(C, ...) GPUTEST_EXPAND_MSVC(C(__VA_ARGS__)) #define GPUTEST_SELECT(a1, a2, N, ...) N #define GPUTEST_CONTEXT_ARGS1(a1) GrContext* a1 -#define GPUTEST_CONTEXT_ARGS2(a1, a2) GrContext* a1, SkGLContext* a2 +#define GPUTEST_CONTEXT_ARGS2(a1, a2) GrContext* a1, sk_gpu_test::GLContext* a2 #define GPUTEST_CONTEXT_ARGS(...) \ GPUTEST_APPLY(GPUTEST_SELECT(__VA_ARGS__, GPUTEST_CONTEXT_ARGS2, GPUTEST_CONTEXT_ARGS1), \ __VA_ARGS__) -#define DEF_GPUTEST(name, reporter, factory) \ - static void test_##name(skiatest::Reporter*, GrContextFactory*); \ - skiatest::TestRegistry name##TestRegistry( \ - skiatest::Test(#name, true, test_##name)); \ - void test_##name(skiatest::Reporter* reporter, GrContextFactory* factory) +#define DEF_GPUTEST(name, reporter, factory) \ + static void test_##name(skiatest::Reporter*, sk_gpu_test::GrContextFactory*); \ + skiatest::TestRegistry name##TestRegistry( \ + skiatest::Test(#name, true, test_##name)); \ + void test_##name(skiatest::Reporter* reporter, sk_gpu_test::GrContextFactory* factory) #define DEF_GPUTEST_FOR_CONTEXTS(name, contexts, reporter, ...) \ static void test_##name(skiatest::Reporter*, GPUTEST_CONTEXT_ARGS(__VA_ARGS__)); \ static void test_gpu_contexts_##name(skiatest::Reporter* reporter, \ - GrContextFactory* factory) { \ + sk_gpu_test::GrContextFactory* factory) { \ skiatest::RunWithGPUTestContexts(test_##name, contexts, reporter, factory); \ } \ skiatest::TestRegistry name##TestRegistry( \ diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp index 9c030ed9ec..4057a37bb0 100644 --- a/tests/TestConfigParsing.cpp +++ b/tests/TestConfigParsing.cpp @@ -9,6 +9,8 @@ #include "Test.h" #include <initializer_list> +using sk_gpu_test::GrContextFactory; + namespace { // The code // SkCommandLineFlags::StringArray FLAGS_config1 = make_string_array({"a", "b"}) diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp index 890042e19d..05ab9ff697 100644 --- a/tests/TestTest.cpp +++ b/tests/TestTest.cpp @@ -9,7 +9,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" -#include "gl/SkGLContext.h" +#include "gl/GLContext.h" #endif @@ -64,7 +64,7 @@ DEF_GPUTEST_FOR_NULL_CONTEXT(TestGpuNullContext, reporter, context) { #endif // This is an example of a GPU test that tests a property that should work for all GPU contexts. -// It uses the additional SkGLContext* glContext to implement the test. +// It uses the additional GLContext* glContext to implement the test. #if SK_SUPPORT_GPU DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuGrContextAndGLContext, reporter, context, glContext) { REPORTER_ASSERT(reporter, reporter); diff --git a/tests/TextureStorageAllocator.cpp b/tests/TextureStorageAllocator.cpp index 1d226861e2..dd08354136 100644 --- a/tests/TextureStorageAllocator.cpp +++ b/tests/TextureStorageAllocator.cpp @@ -8,9 +8,9 @@ #include "Test.h" #if SK_SUPPORT_GPU #include "gl/GrGLGpu.h" +#include "gl/GLContext.h" #include "GrContext.h" #include "SkSurface_Gpu.h" -#include "../include/gpu/gl/SkGLContext.h" #include "../include/gpu/GrTypes.h" #include "../include/private/SkTemplates.h" diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp index 5d21d1ec15..9783db83a0 100644 --- a/tests/skia_test.cpp +++ b/tests/skia_test.cpp @@ -24,6 +24,7 @@ #endif using namespace skiatest; +using namespace sk_gpu_test; DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); |