diff options
author | bsalomon <bsalomon@google.com> | 2015-10-14 12:54:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-14 12:54:52 -0700 |
commit | 10528f1d5838ae1cac015024c4e8731484f888d1 (patch) | |
tree | 798e83363aee8208c90c929d307ca6403928a469 /src/gpu/gl/GrGLGpu.h | |
parent | fd2b067b9e6a8cc93581a61c67bb8ce3c626f60f (diff) |
Store texture target on GrGLTexture. This is in preparation for using texture targets other than 2D.
Review URL: https://codereview.chromium.org/1403123002
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 13 |
1 files changed, 10 insertions, 3 deletions
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<GrGLContext> fGLContext; |