From 10528f1d5838ae1cac015024c4e8731484f888d1 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Wed, 14 Oct 2015 12:54:52 -0700 Subject: Store texture target on GrGLTexture. This is in preparation for using texture targets other than 2D. Review URL: https://codereview.chromium.org/1403123002 --- src/gpu/gl/GrGLGpu.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/gpu/gl/GrGLGpu.h') diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index dee201292e..3fa498cce8 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -273,6 +273,7 @@ private: GrGLenum* externalType) const; // helper for onCreateTexture and writeTexturePixels bool uploadTexData(const GrSurfaceDesc& desc, + GrGLenum target, bool isNewTexture, int left, int top, int width, int height, GrPixelConfig dataConfig, @@ -286,23 +287,29 @@ private: // the texture is already in GPU memory and that it's going to be updated // with new data. bool uploadCompressedTexData(const GrSurfaceDesc& desc, + GrGLenum target, const void* data, bool isNewTexture = true, int left = 0, int top = 0, int width = -1, int height = -1); bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycle lifeCycle, - GrGLuint texID, GrGLRenderTarget::IDDesc*); + GrGLenum textureTarget, GrGLuint texID, + GrGLRenderTarget::IDDesc*); enum TempFBOTarget { kSrc_TempFBOTarget, kDst_TempFBOTarget }; - GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport, + // Binds a surface as a FBO for a copy operation. If the surface already owns an FBO ID then + // that ID is bound. If not the surface is temporarily bound to a FBO and that FBO is bound. + // This must be paired with a call to unbindSurfaceFBOForCopy(). + void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport, TempFBOTarget tempFBOTarget); - void unbindTextureFromFBO(GrGLenum fboTarget); + // Must be called if bindSurfaceFBOForCopy was used to bind a surface for copying. + void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); SkAutoTUnref fGLContext; -- cgit v1.2.3