diff options
author | Brian Salomon <bsalomon@google.com> | 2018-07-30 13:13:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-30 19:32:13 +0000 |
commit | 7226c232d73356a37ec8cfef0ed55147e68dd2fd (patch) | |
tree | 47559e4a5994b5cffc5382e9bb230f49b6c04cd7 /include/private/GrTypesPriv.h | |
parent | 3ebd354730ea9590bf233deccfc24982ffe48a98 (diff) |
Make GrTextureProxy store a GrTextureType.
Removes flag indicating rectangle or external as its now redundant.
Bug: skia:
Change-Id: Ia475b557390e7a6b0f19f6e189cf8c27090e397c
Reviewed-on: https://skia-review.googlesource.com/144346
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/private/GrTypesPriv.h')
-rw-r--r-- | include/private/GrTypesPriv.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h index db25236e3d..ef6fa54841 100644 --- a/include/private/GrTypesPriv.h +++ b/include/private/GrTypesPriv.h @@ -503,6 +503,20 @@ static inline GrSLType GrSLCombinedSamplerTypeForTextureType(GrTextureType type) return kTexture2DSampler_GrSLType; } +/** Rectangle and external textures ony support the clamp wrap mode and do not support MIP maps. */ +static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) { + switch (type) { + case GrTextureType::k2D: + return false; + case GrTextureType::kRectangle: + return true; + case GrTextureType::kExternal: + return true; + } + SK_ABORT("Unexpected texture type"); + return false; +} + static inline bool GrSLTypeIsCombinedSamplerType(GrSLType type) { switch (type) { case kTexture2DSampler_GrSLType: @@ -851,17 +865,6 @@ enum class GrInternalSurfaceFlags { kSurfaceMask = kNoPendingIO, - // Texture-only flags - - // This flag is for GL only. It says that the GL texture we will use has a target which is - // either GL_TEXTURE_RECTANGLE or GL_GL_TEXTURE_EXTERNAL. We use this information to make - // decisions about various rendering capabilites (e.g. is clamp the only supported wrap mode). - // Note: Ganesh does not internally create these types of textures so they will only occur on - // resources passed into Ganesh. - kIsGLTextureRectangleOrExternal = 1 << 1, - - kTextureMask = kIsGLTextureRectangleOrExternal, - // RT-only // For internal resources: |