diff options
author | Greg Daniel <egdaniel@google.com> | 2017-07-19 14:47:42 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-19 19:13:25 +0000 |
commit | 81e7bf8d6d338d944f3c5075b14c21580398aeb6 (patch) | |
tree | 7c9814e6637dbcdf477f35084381b28f1f98e06a /include | |
parent | fc3afa921bc42a357120e1e7856b3c256bfe1a6a (diff) |
Update gpu caps for valid sample counts.
Instead of query and maxSampleCount and using that to cap, we now have
each config store its supported values and when requested returns either
the next highest or equal supported value, or if non the max config supported.
Bug: skia:
Change-Id: I8802d44c13b3b1703ee54a7e69b82102d4b8dc2d
Reviewed-on: https://skia-review.googlesource.com/24302
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrCaps.h | 19 | ||||
-rw-r--r-- | include/gpu/gl/GrGLFunctions.h | 3 | ||||
-rw-r--r-- | include/gpu/gl/GrGLInterface.h | 3 |
3 files changed, 10 insertions, 15 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index cc24846091..a1a1826676 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -132,22 +132,11 @@ public: It is usually the max texture size, unless we're overriding it for testing. */ int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return fMaxTileSize; } - // Will be 0 if MSAA is not supported - int maxColorSampleCount() const { return fMaxColorSampleCount; } - // Will be 0 if MSAA is not supported - int maxStencilSampleCount() const { return fMaxStencilSampleCount; } - // Will be 0 if raster multisample is not supported. Raster multisample is a special HW mode - // where the rasterizer runs with more samples than are in the target framebuffer. int maxRasterSamples() const { return fMaxRasterSamples; } - // We require the sample count to be less than maxColorSampleCount and maxStencilSampleCount. - // If we are using mixed samples, we only care about stencil. - int maxSampleCount() const { - if (this->usesMixedSamples()) { - return this->maxStencilSampleCount(); - } else { - return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCount()); - } - } + + // Find a sample count greater than or equal to the requested count which is supported for a + // color buffer of the given config. If MSAA is not support for the config we will return 0. + virtual int getSampleCount(int requestedCount, GrPixelConfig config) const = 0; int maxWindowRectangles() const { return fMaxWindowRectangles; } diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h index 930a0c1aad..5166a4b099 100644 --- a/include/gpu/gl/GrGLFunctions.h +++ b/include/gpu/gl/GrGLFunctions.h @@ -357,6 +357,9 @@ typedef GrGLenum (GR_GL_FUNCTION_TYPE* GrGLClientWaitSyncProc)(GrGLsync sync, Gr typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLWaitSyncProc)(GrGLsync sync, GrGLbitfield flags, GrGLuint64 timeout); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDeleteSyncProc)(GrGLsync sync); +/* ARB_internalformat_query */ +typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetInternalformativProc)(GrGLenum target, GrGLenum internalformat, GrGLenum pname, GrGLsizei bufSize, GrGLint *params); + /* KHR_debug */ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDebugMessageControlProc)(GrGLenum source, GrGLenum type, GrGLenum severity, GrGLsizei count, const GrGLuint* ids, GrGLboolean enabled); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDebugMessageInsertProc)(GrGLenum source, GrGLenum type, GrGLuint id, GrGLenum severity, GrGLsizei length, const GrGLchar* buf); diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index e5479eb466..10880471ce 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h @@ -460,6 +460,9 @@ public: GrGLFunction<GrGLWaitSyncProc> fWaitSync; GrGLFunction<GrGLDeleteSyncProc> fDeleteSync; + /* ARB_internalforamt_query */ + GrGLFunction<GrGLGetInternalformativProc> fGetInternalformativ; + /* KHR_debug */ GrGLFunction<GrGLDebugMessageControlProc> fDebugMessageControl; GrGLFunction<GrGLDebugMessageInsertProc> fDebugMessageInsert; |