Add internal grsurface flag to track if using gl rectangle or external texture.
Bug: skia:
Change-Id: I84963833bbc3ae957c919a19f6e78fce2c9de7ef
Reviewed-on: https://skia-review.googlesource.com/125294
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrSurfacePriv.h b/src/gpu/GrSurfacePriv.h
index 98d8fc5..5c98e3f 100644
--- a/src/gpu/GrSurfacePriv.h
+++ b/src/gpu/GrSurfacePriv.h
@@ -41,7 +41,11 @@
GrInternalSurfaceFlags flags() const { return fSurface->fSurfaceFlags; }
bool doesNotSupportMipMaps() const { return fSurface->doesNotSupportMipMaps(); }
- bool isClampOnly() const { return fSurface->isClampOnly(); }
+ bool isGLTextureRectangleOrExternal() const {
+ return fSurface->isGLTextureRectangleOrExternal();
+ }
+ // We only support the clamp wrap mode with gl rectangle or external textures.
+ bool isClampOnly() const { return fSurface->isGLTextureRectangleOrExternal(); }
private:
explicit GrSurfacePriv(GrSurface* surface) : fSurface(surface) {}
diff --git a/src/gpu/GrTextureProxyPriv.h b/src/gpu/GrTextureProxyPriv.h
index b2b0028..8f50b90 100644
--- a/src/gpu/GrTextureProxyPriv.h
+++ b/src/gpu/GrTextureProxyPriv.h
@@ -32,7 +32,11 @@
GrMipMapped proxyMipMapped() const { return fTextureProxy->fMipMapped; }
bool doesNotSupportMipMaps() const { return fTextureProxy->doesNotSupportMipMaps(); }
- bool isClampOnly() const { return fTextureProxy->isClampOnly(); }
+ bool isGLTextureRectangleOrExternal() const {
+ return fTextureProxy->isGLTextureRectangleOrExternal();
+ }
+ // We only support the clamp wrap mode with gl rectangle or external textures.
+ bool isClampOnly() const { return fTextureProxy->isGLTextureRectangleOrExternal(); }
void setDoesNotSupportMipMaps() {
fTextureProxy->setDoesNotSupportMipMaps();
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index 9a8dbd8..bf22bdb 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -71,8 +71,7 @@
SkASSERT(0 != idDesc.fInfo.fFormat);
if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE ||
idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) {
- this->setDoesNotSupportMipMaps();
- this->setIsClampOnly();
+ this->setIsGLTextureRectangleOrExternal();
}
fTexParams.invalidate();
fTexParamsTimestamp = GrGpu::kExpiredTimestamp;