diff options
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: |