diff options
author | bsalomon <bsalomon@google.com> | 2016-04-04 05:56:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-04 05:56:59 -0700 |
commit | b4b4cf36c66900fdfaf63106d54a8fac786a3313 (patch) | |
tree | a2edd68802089e9b46d65d187fc6e9e47b398c44 /dm | |
parent | aee62f563968437bff0ffdc5aa6185781a81bfd3 (diff) |
Revert of Rename enums in GrContextFactory to remove "GL" (patchset #4 id:60001 of https://codereview.chromium.org/1845923004/ )
Reason for revert:
Many GM images unexpectedly changed with this CL.
Original issue's description:
> Rename enums in GrContextFactory to remove "GL"
>
> Also, remove kNative as a separate context type and instead make it an alias for kGL or kGLES based on OS.
>
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845923004
>
> Committed: https://skia.googlesource.com/skia/+/2d9c6f81353597aebf5934547e5cba7a872196fb
TBR=egdaniel@google.com,jvanverth@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
Review URL: https://codereview.chromium.org/1856703002
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 45 | ||||
-rw-r--r-- | dm/DMGpuSupport.h | 38 | ||||
-rw-r--r-- | dm/DMSrcSink.cpp | 4 | ||||
-rw-r--r-- | dm/DMSrcSink.h | 8 |
4 files changed, 46 insertions, 49 deletions
@@ -814,17 +814,17 @@ static Sink* create_sink(const SkCommandLineConfig* config) { #if SK_SUPPORT_GPU if (gpu_supported()) { if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) { - GrContextFactory::ContextType contextType = gpuConfig->getContextType(); - GrContextFactory::ContextOptions contextOptions = - GrContextFactory::kNone_ContextOptions; + GrContextFactory::GLContextType contextType = gpuConfig->getContextType(); + GrContextFactory::GLContextOptions contextOptions = + GrContextFactory::kNone_GLContextOptions; if (gpuConfig->getUseNVPR()) { - contextOptions = static_cast<GrContextFactory::ContextOptions>( - contextOptions | GrContextFactory::kEnableNVPR_ContextOptions); + contextOptions = static_cast<GrContextFactory::GLContextOptions>( + contextOptions | GrContextFactory::kEnableNVPR_GLContextOptions); } if (kSRGB_SkColorProfileType == gpuConfig->getProfileType() || kRGBA_F16_SkColorType == gpuConfig->getColorType()) { - contextOptions = static_cast<GrContextFactory::ContextOptions>( - contextOptions | GrContextFactory::kRequireSRGBSupport_ContextOptions); + contextOptions = static_cast<GrContextFactory::GLContextOptions>( + contextOptions | GrContextFactory::kRequireSRGBSupport_GLContextOptions); } GrContextFactory testFactory; if (!testFactory.get(contextType, contextOptions)) { @@ -1442,36 +1442,35 @@ void RunWithGPUTestContexts(T test, GPUTestContexts testContexts, Reporter* repo // Iterate over context types, except use "native" instead of explicitly trying OpenGL and // OpenGL ES. Do not use GLES on desktop, since tests do not account for not fixing // http://skbug.com/2809 - GrContextFactory::ContextType contextTypes[] = { - GrContextFactory::kNativeGL_ContextType, + GrContextFactory::GLContextType contextTypes[] = { + GrContextFactory::kNative_GLContextType, #if SK_ANGLE #ifdef SK_BUILD_FOR_WIN - GrContextFactory::kANGLE_ContextType, + GrContextFactory::kANGLE_GLContextType, #endif - GrContextFactory::kANGLE_GL_ContextType, + GrContextFactory::kANGLE_GL_GLContextType, #endif #if SK_COMMAND_BUFFER - GrContextFactory::kCommandBuffer_ContextType, + GrContextFactory::kCommandBuffer_GLContextType, #endif #if SK_MESA - GrContextFactory::kMESA_ContextType, + GrContextFactory::kMESA_GLContextType, #endif - GrContextFactory::kNullGL_ContextType, - GrContextFactory::kDebugGL_ContextType, + GrContextFactory::kNull_GLContextType, + GrContextFactory::kDebug_GLContextType, }; - // Should have named all the context types except one of GL or GLES. - static_assert(SK_ARRAY_COUNT(contextTypes) == GrContextFactory::kContextTypeCnt - 1, - "Skipping unexpected ContextType for GPU tests"); + static_assert(SK_ARRAY_COUNT(contextTypes) == GrContextFactory::kGLContextTypeCnt - 2, + "Skipping unexpected GLContextType for GPU tests"); for (auto& contextType : contextTypes) { int contextSelector = kNone_GPUTestContexts; - if (GrContextFactory::IsRenderingContext(contextType)) { + if (GrContextFactory::IsRenderingGLContext(contextType)) { contextSelector |= kAllRendering_GPUTestContexts; - } else if (contextType == GrContextFactory::kNativeGL_ContextType) { + } else if (contextType == GrContextFactory::kNative_GLContextType) { contextSelector |= kNative_GPUTestContexts; - } else if (contextType == GrContextFactory::kNullGL_ContextType) { + } else if (contextType == GrContextFactory::kNull_GLContextType) { contextSelector |= kNull_GPUTestContexts; - } else if (contextType == GrContextFactory::kDebugGL_ContextType) { + } else if (contextType == GrContextFactory::kDebug_GLContextType) { contextSelector |= kDebug_GPUTestContexts; } if ((testContexts & contextSelector) == 0) { @@ -1482,7 +1481,7 @@ void RunWithGPUTestContexts(T test, GPUTestContexts testContexts, Reporter* repo call_test(test, reporter, context); } context = factory->getContextInfo(contextType, - GrContextFactory::kEnableNVPR_ContextOptions); + GrContextFactory::kEnableNVPR_GLContextOptions); if (context.fGrContext) { call_test(test, reporter, context); } diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h index 2352f83ae4..490737f41e 100644 --- a/dm/DMGpuSupport.h +++ b/dm/DMGpuSupport.h @@ -30,8 +30,8 @@ static const bool kGPUDisabled = false; static inline sk_sp<SkSurface> NewGpuSurface( sk_gpu_test::GrContextFactory* grFactory, - sk_gpu_test::GrContextFactory::ContextType type, - sk_gpu_test::GrContextFactory::ContextOptions options, + sk_gpu_test::GrContextFactory::GLContextType type, + sk_gpu_test::GrContextFactory::GLContextOptions options, SkImageInfo info, int samples, bool useDIText) { @@ -66,22 +66,20 @@ public: GrContextFactory() {}; explicit GrContextFactory(const GrContextOptions&) {} - typedef int ContextType; - - static const ContextType kANGLE_ContextType = 0, - kANGLE_GL_ContextType = 0, - kCommandBuffer_ContextType = 0, - kDebugGL_ContextType = 0, - kMESA_ContextType = 0, - kNVPR_ContextType = 0, - kNativeGL_ContextType = 0, - kGL_ContextType = 0, - kGLES_ContextType = 0, - kNullGL_ContextType = 0; - static const int kContextTypeCnt = 1; - enum ContextOptions { - kNone_ContextOptions = 0, - kEnableNVPR_ContextOptions = 0x1, + typedef int GLContextType; + + static const GLContextType kANGLE_GLContextType = 0, + kANGLE_GL_GLContextType = 0, + kCommandBuffer_GLContextType = 0, + kDebug_GLContextType = 0, + kMESA_GLContextType = 0, + kNVPR_GLContextType = 0, + kNative_GLContextType = 0, + kNull_GLContextType = 0; + static const int kGLContextTypeCnt = 1; + enum GLContextOptions { + kNone_GLContextOptions = 0, + kEnableNVPR_GLContextOptions = 0x1, }; void destroyContexts() {} @@ -96,8 +94,8 @@ namespace DM { static const bool kGPUDisabled = true; static inline SkSurface* NewGpuSurface(sk_gpu_test::GrContextFactory*, - sk_gpu_test::GrContextFactory::ContextType, - sk_gpu_test::GrContextFactory::ContextOptions, + sk_gpu_test::GrContextFactory::GLContextType, + sk_gpu_test::GrContextFactory::GLContextOptions, SkImageInfo, int, bool) { diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index a24dad429b..6584789a0b 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -941,8 +941,8 @@ Error NullSink::draw(const Src& src, SkBitmap*, SkWStream*, SkString*) const { DEFINE_bool(gpuStats, false, "Append GPU stats to the log for each GPU task?"); -GPUSink::GPUSink(GrContextFactory::ContextType ct, - GrContextFactory::ContextOptions options, +GPUSink::GPUSink(GrContextFactory::GLContextType ct, + GrContextFactory::GLContextOptions options, int samples, bool diText, SkColorType colorType, diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index aec5a30d1a..3a35acf005 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -232,8 +232,8 @@ public: class GPUSink : public Sink { public: - GPUSink(sk_gpu_test::GrContextFactory::ContextType, - sk_gpu_test::GrContextFactory::ContextOptions, + GPUSink(sk_gpu_test::GrContextFactory::GLContextType, + sk_gpu_test::GrContextFactory::GLContextOptions, int samples, bool diText, SkColorType colorType, SkColorProfileType profileType, bool threaded); @@ -242,8 +242,8 @@ public: const char* fileExtension() const override { return "png"; } SinkFlags flags() const override { return SinkFlags{ SinkFlags::kGPU, SinkFlags::kDirect }; } private: - sk_gpu_test::GrContextFactory::ContextType fContextType; - sk_gpu_test::GrContextFactory::ContextOptions fContextOptions; + sk_gpu_test::GrContextFactory::GLContextType fContextType; + sk_gpu_test::GrContextFactory::GLContextOptions fContextOptions; int fSampleCount; bool fUseDIText; SkColorType fColorType; |