diff options
author | 2015-04-01 06:29:49 -0700 | |
---|---|---|
committer | 2015-04-01 06:29:49 -0700 | |
commit | 08b4d29a0a29badc15129c9bc7ee8352bc75278d (patch) | |
tree | 6248d16e63e467ed9a29ef47cc4a11aba762d8f7 /src/gpu/gl | |
parent | 7c0273f107d571a2147e4b2ad3f36c917bb12b22 (diff) |
GrGLInterface: Add support for NV_framebuffer_mixed_samples
Import glCoverageModulation if NV_framebuffer_mixed samples
is available
BUG=skia:3177
Review URL: https://codereview.chromium.org/993363002
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 3 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 6 |
4 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index c91da9e6c7..6a4fbe20e0 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -278,6 +278,10 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(PathMemoryGlyphIndexArray, NV); } + if (extensions.has("GL_NV_framebuffer_mixed_samples")) { + GET_PROC_SUFFIX(CoverageModulation, NV); + } + if (extensions.has("GL_EXT_debug_marker")) { GET_PROC_SUFFIX(InsertEventMarker, EXT); GET_PROC_SUFFIX(PushGroupMarker, EXT); @@ -519,6 +523,10 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(PathMemoryGlyphIndexArray, NV); } + if (extensions.has("GL_NV_framebuffer_mixed_samples")) { + GET_PROC_SUFFIX(CoverageModulation, NV); + } + interface->fStandard = kGLES_GrGLStandard; interface->fExtensions.swap(&extensions); diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index c9009b9053..fe52a540c6 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -54,6 +54,7 @@ void GrGLCaps::reset() { fFBFetchNeedsCustomOutput = false; fFBFetchColorName = NULL; fFBFetchExtensionString = NULL; + fFBMixedSamplesSupport = false; fReadPixelsSupportedCache.reset(); } @@ -99,6 +100,7 @@ GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { fFBFetchNeedsCustomOutput = caps.fFBFetchNeedsCustomOutput; fFBFetchColorName = caps.fFBFetchColorName; fFBFetchExtensionString = caps.fFBFetchExtensionString; + fFBMixedSamplesSupport = caps.fFBMixedSamplesSupport; return *this; } @@ -371,6 +373,8 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { fNvprSupport = kNone_NvprSupport; } + fFBMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples"); + fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); // For now these two are equivalent but we could have dst read in shader via some other method diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index d81e34b35e..53587e1ad6 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -178,6 +178,8 @@ public: const char* fbFetchExtensionString() const { return fFBFetchExtensionString; } + bool fbMixedSamplesSupport() const { return fFBMixedSamplesSupport; } + InvalidateFBType invalidateFBType() const { return fInvalidateFBType; } /// What type of buffer mapping is supported? @@ -389,6 +391,7 @@ private: bool fDropsTileOnZeroDivide : 1; bool fFBFetchSupport : 1; bool fFBFetchNeedsCustomOutput : 1; + bool fFBMixedSamplesSupport : 1; const char* fFBFetchColorName; const char* fFBFetchExtensionString; diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index dba005976f..2e3dd1f039 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -505,5 +505,11 @@ bool GrGLInterface::validate() const { } } + if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { + if (NULL == fFunctions.fCoverageModulation) { + RETURN_FALSE_INTERFACE + } + } + return true; } |