Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: src/gpu/gl/GrGLGpu.h

Issue 964543002: Revert of Improve tracking of bound FBOs in GrGLGpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.h
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 0ec69c0660beecd556b593a50f24c6486f6bf9c5..b93080b70037d2b5a624b0b9996dc7b798adad12 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -246,25 +246,9 @@
// 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 @@
bool createRenderTargetObjects(const GrSurfaceDesc&, bool budgeted, GrGLuint texID,
GrGLRenderTarget::IDDesc*);
- static const FBOBinding kInvalidFBOBinding = static_cast<FBOBinding>(-1);
-
- // 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);
-
- // Must be matched with bindSurfaceAsFBOForCopy.
- void unbindSurfaceAsFBOForCopy(FBOBinding);
+ enum TempFBOTarget {
+ kSrc_TempFBOTarget,
+ kDst_TempFBOTarget
+ };
+
+ GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect* viewport,
+ TempFBOTarget tempFBOTarget);
+
+ void unbindTextureFromFBO(GrGLenum fboTarget);
GrGLContext fGLContext;
@@ -324,9 +309,10 @@
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,13 +458,8 @@
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];
///@}
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698