From 7226c232d73356a37ec8cfef0ed55147e68dd2fd Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Mon, 30 Jul 2018 13:13:17 -0400 Subject: 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 Commit-Queue: Brian Salomon --- include/private/GrTypesPriv.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'include/private/GrTypesPriv.h') 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: -- cgit v1.2.3