gfx/angle/src/libGLESv2/Framebuffer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/libGLESv2/Framebuffer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,108 @@
     1.4 +//
     1.5 +// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +// Framebuffer.h: Defines the gl::Framebuffer class. Implements GL framebuffer
    1.11 +// objects and related functionality. [OpenGL ES 2.0.24] section 4.4 page 105.
    1.12 +
    1.13 +#ifndef LIBGLESV2_FRAMEBUFFER_H_
    1.14 +#define LIBGLESV2_FRAMEBUFFER_H_
    1.15 +
    1.16 +#include "common/angleutils.h"
    1.17 +#include "common/RefCountObject.h"
    1.18 +#include "Constants.h"
    1.19 +
    1.20 +namespace rx
    1.21 +{
    1.22 +class Renderer;
    1.23 +}
    1.24 +
    1.25 +namespace gl
    1.26 +{
    1.27 +class Renderbuffer;
    1.28 +class Colorbuffer;
    1.29 +class Depthbuffer;
    1.30 +class Stencilbuffer;
    1.31 +class DepthStencilbuffer;
    1.32 +
    1.33 +class Framebuffer
    1.34 +{
    1.35 +  public:
    1.36 +    explicit Framebuffer(rx::Renderer *renderer);
    1.37 +
    1.38 +    virtual ~Framebuffer();
    1.39 +
    1.40 +    void setColorbuffer(unsigned int colorAttachment, GLenum type, GLuint colorbuffer);
    1.41 +    void setDepthbuffer(GLenum type, GLuint depthbuffer);
    1.42 +    void setStencilbuffer(GLenum type, GLuint stencilbuffer);
    1.43 +
    1.44 +    void detachTexture(GLuint texture);
    1.45 +    void detachRenderbuffer(GLuint renderbuffer);
    1.46 +
    1.47 +    unsigned int getRenderTargetSerial(unsigned int colorAttachment) const;
    1.48 +    unsigned int getDepthbufferSerial() const;
    1.49 +    unsigned int getStencilbufferSerial() const;
    1.50 +
    1.51 +    Renderbuffer *getColorbuffer(unsigned int colorAttachment) const;
    1.52 +    Renderbuffer *getDepthbuffer() const;
    1.53 +    Renderbuffer *getStencilbuffer() const;
    1.54 +    Renderbuffer *getDepthOrStencilbuffer() const;
    1.55 +    Renderbuffer *getReadColorbuffer() const;
    1.56 +    GLenum getReadColorbufferType() const;
    1.57 +    Renderbuffer *getFirstColorbuffer() const;
    1.58 +
    1.59 +    GLenum getColorbufferType(unsigned int colorAttachment) const;
    1.60 +    GLenum getDepthbufferType() const;
    1.61 +    GLenum getStencilbufferType() const;
    1.62 +
    1.63 +    GLuint getColorbufferHandle(unsigned int colorAttachment) const;
    1.64 +    GLuint getDepthbufferHandle() const;
    1.65 +    GLuint getStencilbufferHandle() const;
    1.66 +
    1.67 +    GLenum getDrawBufferState(unsigned int colorAttachment) const;
    1.68 +    void setDrawBufferState(unsigned int colorAttachment, GLenum drawBuffer);
    1.69 +
    1.70 +    bool isEnabledColorAttachment(unsigned int colorAttachment) const;
    1.71 +    bool hasEnabledColorAttachment() const;
    1.72 +    bool hasStencil() const;
    1.73 +    int getSamples() const;
    1.74 +    bool usingExtendedDrawBuffers() const;
    1.75 +
    1.76 +    virtual GLenum completeness() const;
    1.77 +
    1.78 +  protected:
    1.79 +    GLenum mColorbufferTypes[IMPLEMENTATION_MAX_DRAW_BUFFERS];
    1.80 +    BindingPointer<Renderbuffer> mColorbufferPointers[IMPLEMENTATION_MAX_DRAW_BUFFERS];
    1.81 +    GLenum mDrawBufferStates[IMPLEMENTATION_MAX_DRAW_BUFFERS];
    1.82 +    GLenum mReadBufferState;
    1.83 +
    1.84 +    GLenum mDepthbufferType;
    1.85 +    BindingPointer<Renderbuffer> mDepthbufferPointer;
    1.86 +
    1.87 +    GLenum mStencilbufferType;
    1.88 +    BindingPointer<Renderbuffer> mStencilbufferPointer;
    1.89 +
    1.90 +    rx::Renderer *mRenderer;
    1.91 +
    1.92 +  private:
    1.93 +    DISALLOW_COPY_AND_ASSIGN(Framebuffer);
    1.94 +
    1.95 +    Renderbuffer *lookupRenderbuffer(GLenum type, GLuint handle) const;
    1.96 +};
    1.97 +
    1.98 +class DefaultFramebuffer : public Framebuffer
    1.99 +{
   1.100 +  public:
   1.101 +    DefaultFramebuffer(rx::Renderer *Renderer, Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil);
   1.102 +
   1.103 +    virtual GLenum completeness() const;
   1.104 +
   1.105 +  private:
   1.106 +    DISALLOW_COPY_AND_ASSIGN(DefaultFramebuffer);
   1.107 +};
   1.108 +
   1.109 +}
   1.110 +
   1.111 +#endif   // LIBGLESV2_FRAMEBUFFER_H_

mercurial