diff options
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLTexture.cpp | 12 | ||||
-rw-r--r-- | src/gpu/gl/GrGLTexture.h | 3 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 5532e36bd0..0fc88437b0 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -2185,8 +2185,8 @@ bool GrGLCaps::canCopySurface(const GrSurfaceProxy* dst, const GrSurfaceProxy* s const GrTextureProxy* dstTex = dst->asTextureProxy(); const GrTextureProxy* srcTex = src->asTextureProxy(); - bool dstIsTex2D = dstTex ? dstTex->texPriv().isGLTexture2D() : false; - bool srcIsTex2D = srcTex ? srcTex->texPriv().isGLTexture2D() : false; + bool dstIsTex2D = dstTex ? (dstTex->texPriv().textureType() == GrTextureType::k2D) : false; + bool srcIsTex2D = srcTex ? (srcTex->texPriv().textureType() == GrTextureType::k2D) : false; // One of the possible requirements for copy as blit is that the srcRect must match the bounds // of the src surface. If we have a approx fit surface we can't know for sure what the src diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp index f0fafabcba..200c8d22e8 100644 --- a/src/gpu/gl/GrGLTexture.cpp +++ b/src/gpu/gl/GrGLTexture.cpp @@ -15,7 +15,7 @@ #define GPUGL static_cast<GrGLGpu*>(this->getGpu()) #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) -static inline GrTextureType texture_type_from_target(GrGLenum target) { +GrTextureType GrGLTexture::TextureTypeFromTarget(GrGLenum target) { switch (target) { case GR_GL_TEXTURE_2D: return GrTextureType::k2D; @@ -55,7 +55,7 @@ static inline GrSamplerState::Filter highest_filter_mode(const GrGLTexture::IDDe GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc, const IDDesc& idDesc, GrMipMapsStatus mipMapsStatus) : GrSurface(gpu, desc) - , INHERITED(gpu, desc, texture_type_from_target(idDesc.fInfo.fTarget), + , INHERITED(gpu, desc, TextureTypeFromTarget(idDesc.fInfo.fTarget), highest_filter_mode(idDesc, desc.fConfig), mipMapsStatus) { this->init(desc, idDesc); this->registerWithCache(budgeted); @@ -64,7 +64,7 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc, GrMipMapsStatus mipMapsStatus, const IDDesc& idDesc) : GrSurface(gpu, desc) - , INHERITED(gpu, desc, texture_type_from_target(idDesc.fInfo.fTarget), + , INHERITED(gpu, desc, TextureTypeFromTarget(idDesc.fInfo.fTarget), highest_filter_mode(idDesc, desc.fConfig), mipMapsStatus) { this->init(desc, idDesc); this->registerWithCacheWrapped(); @@ -73,7 +73,7 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc, GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, GrMipMapsStatus mipMapsStatus) : GrSurface(gpu, desc) - , INHERITED(gpu, desc, texture_type_from_target(idDesc.fInfo.fTarget), + , INHERITED(gpu, desc, TextureTypeFromTarget(idDesc.fInfo.fTarget), highest_filter_mode(idDesc, desc.fConfig), mipMapsStatus) { this->init(desc, idDesc); } @@ -81,10 +81,6 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) { SkASSERT(0 != idDesc.fInfo.fID); SkASSERT(0 != idDesc.fInfo.fFormat); - if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE || - idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) { - this->setIsGLTextureRectangleOrExternal(); - } fTexParams.invalidate(); fTexParamsTimestamp = GrGpu::kExpiredTimestamp; fID = idDesc.fInfo.fID; diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h index 298f1faf11..cb029cca81 100644 --- a/src/gpu/gl/GrGLTexture.h +++ b/src/gpu/gl/GrGLTexture.h @@ -31,6 +31,9 @@ public: GrGLTextureInfo fInfo; GrBackendObjectOwnership fOwnership; }; + + static GrTextureType TextureTypeFromTarget(GrGLenum textureTarget); + GrGLTexture(GrGLGpu*, SkBudgeted, const GrSurfaceDesc&, const IDDesc&, GrMipMapsStatus); ~GrGLTexture() override { |