aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-03-01 07:38:15 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-01 07:38:15 -0800
commit73165bd417d6cd4b4513df54b58e23e33f151a3f (patch)
tree570e956f01d12e2fc0e51ebb106c15a600c56a36 /src/gpu/gl/GrGLGpu.h
parent3d32d50364d1b63777fbf05c3593a35601bde9e2 (diff)
Revert of Improve tracking of bound FBOs in GrGLGpu. (patchset #10 id:180001 of https://codereview.chromium.org/949263002/)
Reason for revert: Experimentally reverting to see if this is the cause of the mac_chromium_rel_ng roll-blocking failures. Original issue's description: > Improve tracking of bound FBOs in GrGLGpu. > > Committed: https://skia.googlesource.com/skia/+/d2ad8eb5801e2c8c0fa544a6a776bb46eedde2a0 > > Committed: https://skia.googlesource.com/skia/+/b2af2d8b83ca4774c3b3bb1e49bc72605faa9589 > > Committed: https://skia.googlesource.com/skia/+/0b70b86a7e9fda52ee7ebc1b9897eeaa09b9abef TBR=egdaniel@google.com,bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/970613003
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r--src/gpu/gl/GrGLGpu.h49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 0ec69c0660..b93080b700 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -246,25 +246,9 @@ private:
// ensures that such operations don't negatively interact with tracking bound textures.
void setScratchTextureUnit();
- // Binds the render target, sets the viewport, tracks dirty are for resolve, and tracks whether
- // mip maps need rebuilding. bounds is region that may be modified by the draw. NULL means whole
- // target. Can be an empty rect.
- void prepareToDrawToRenderTarget(GrGLRenderTarget*, const SkIRect* bounds);
-
- // On older GLs there may not be separate FBO bindings for draw and read. In that case these
- // alias each other.
- enum FBOBinding {
- kDraw_FBOBinding, // drawing or dst of blit
- kRead_FBOBinding, // src of blit, read pixels.
-
- kLast_FBOBinding = kRead_FBOBinding
- };
- static const int kFBOBindingCnt = kLast_FBOBinding + 1;
-
- // binds the FBO and returns the GL enum of the framebuffer target it was bound to.
- GrGLenum bindFBO(FBOBinding, const GrGLFBO*);
-
- void setViewport(const GrGLIRect& viewport);
+ // bounds is region that may be modified and therefore has to be resolved.
+ // NULL means whole target. Can be an empty rect.
+ void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds);
void flushStencil(const GrStencilSettings&);
void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool isLineDraw);
@@ -297,14 +281,15 @@ private:
bool createRenderTargetObjects(const GrSurfaceDesc&, bool budgeted, GrGLuint texID,
GrGLRenderTarget::IDDesc*);
- static const FBOBinding kInvalidFBOBinding = static_cast<FBOBinding>(-1);
+ enum TempFBOTarget {
+ kSrc_TempFBOTarget,
+ kDst_TempFBOTarget
+ };
- // Binds a surface as an FBO. A temporary FBO ID may be used if the surface is not already
- // a render target. Afterwards unbindSurfaceAsFBOForCopy must be called with the value returned.
- FBOBinding bindSurfaceAsFBOForCopy(GrSurface*, FBOBinding, GrGLIRect* viewport);
+ GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport,
+ TempFBOTarget tempFBOTarget);
- // Must be matched with bindSurfaceAsFBOForCopy.
- void unbindSurfaceAsFBOForCopy(FBOBinding);
+ void unbindTextureFromFBO(GrGLenum fboTarget);
GrGLContext fGLContext;
@@ -324,9 +309,10 @@ private:
kUnknown_TriState
};
- SkAutoTUnref<GrGLFBO> fTempSrcFBO;
- SkAutoTUnref<GrGLFBO> fTempDstFBO;
- SkAutoTUnref<GrGLFBO> fStencilClearFBO;
+ GrGLuint fTempSrcFBOID;
+ GrGLuint fTempDstFBOID;
+
+ GrGLuint fStencilClearFBOID;
// last scissor / viewport scissor state seen by the GL.
struct {
@@ -472,14 +458,9 @@ private:
GrPipelineBuilder::DrawFace fHWDrawFace;
TriState fHWWriteToColor;
TriState fHWDitherEnabled;
+ uint32_t fHWBoundRenderTargetUniqueID;
SkTArray<uint32_t, true> fHWBoundTextureUniqueIDs;
- // Track fbo binding state.
- struct HWFBOBinding {
- SkAutoTUnref<const GrGLFBO> fFBO;
- void invalidate() { fFBO.reset(NULL); }
- } fHWFBOBinding[kFBOBindingCnt];
-
///@}
// we record what stencil format worked last time to hopefully exit early