diff options
Diffstat (limited to 'include/gpu/GrSurface.h')
-rw-r--r-- | include/gpu/GrSurface.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h index 3a7294b26e..f3771a74e2 100644 --- a/include/gpu/GrSurface.h +++ b/include/gpu/GrSurface.h @@ -63,9 +63,20 @@ public: GrMipMapped, bool useNextPow2 = false); protected: + void setDoesNotSupportMipMaps() { + SkASSERT(this->asTexture()); + fSurfaceFlags |= GrInternalSurfaceFlags::kDoesNotSupportMipMaps; + } + bool doesNotSupportMipMaps() const { + return fSurfaceFlags & GrInternalSurfaceFlags::kDoesNotSupportMipMaps; + } + void setIsGLTextureRectangleOrExternal() { SkASSERT(this->asTexture()); fSurfaceFlags |= GrInternalSurfaceFlags::kIsGLTextureRectangleOrExternal; + // If we are a GL rectangle or external texture, it also means that we do not support + // generating mip maps. + this->setDoesNotSupportMipMaps(); } bool isGLTextureRectangleOrExternal() const { return fSurfaceFlags & GrInternalSurfaceFlags::kIsGLTextureRectangleOrExternal; |