gfx/skia/trunk/src/gpu/gl/debug/GrFrameBufferObj.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2012 Google Inc.
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9 #ifndef GrFrameBufferObj_DEFINED
michael@0 10 #define GrFrameBufferObj_DEFINED
michael@0 11
michael@0 12 #include "GrFakeRefObj.h"
michael@0 13 class GrFBBindableObj;
michael@0 14
michael@0 15 ////////////////////////////////////////////////////////////////////////////////
michael@0 16 // TODO: when a framebuffer obj is bound the GL_SAMPLES query must return 0
michael@0 17 // TODO: GL_STENCIL_BITS must also be redirected to the framebuffer
michael@0 18 class GrFrameBufferObj : public GrFakeRefObj {
michael@0 19 GR_DEFINE_CREATOR(GrFrameBufferObj);
michael@0 20
michael@0 21 public:
michael@0 22 GrFrameBufferObj()
michael@0 23 : GrFakeRefObj()
michael@0 24 , fBound(false)
michael@0 25 , fColorBuffer(NULL)
michael@0 26 , fDepthBuffer(NULL)
michael@0 27 , fStencilBuffer(NULL) {
michael@0 28 }
michael@0 29
michael@0 30 virtual ~GrFrameBufferObj() {
michael@0 31 fColorBuffer = NULL;
michael@0 32 fDepthBuffer = NULL;
michael@0 33 fStencilBuffer = NULL;
michael@0 34 }
michael@0 35
michael@0 36 void setBound() { fBound = true; }
michael@0 37 void resetBound() { fBound = false; }
michael@0 38 bool getBound() const { return fBound; }
michael@0 39
michael@0 40 void setColor(GrFBBindableObj *buffer);
michael@0 41 GrFBBindableObj *getColor() { return fColorBuffer; }
michael@0 42
michael@0 43 void setDepth(GrFBBindableObj *buffer);
michael@0 44 GrFBBindableObj *getDepth() { return fDepthBuffer; }
michael@0 45
michael@0 46 void setStencil(GrFBBindableObj *buffer);
michael@0 47 GrFBBindableObj *getStencil() { return fStencilBuffer; }
michael@0 48
michael@0 49 virtual void deleteAction() SK_OVERRIDE {
michael@0 50
michael@0 51 setColor(NULL);
michael@0 52 setDepth(NULL);
michael@0 53 setStencil(NULL);
michael@0 54
michael@0 55 this->INHERITED::deleteAction();
michael@0 56 }
michael@0 57
michael@0 58 protected:
michael@0 59 private:
michael@0 60 bool fBound; // is this frame buffer currently bound via "glBindFramebuffer"?
michael@0 61 GrFBBindableObj * fColorBuffer;
michael@0 62 GrFBBindableObj * fDepthBuffer;
michael@0 63 GrFBBindableObj * fStencilBuffer;
michael@0 64
michael@0 65 typedef GrFakeRefObj INHERITED;
michael@0 66 };
michael@0 67
michael@0 68 #endif // GrFrameBufferObj_DEFINED

mercurial