gfx/angle/src/libGLESv2/Framebuffer.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 //
     2 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 // Framebuffer.h: Defines the gl::Framebuffer class. Implements GL framebuffer
     8 // objects and related functionality. [OpenGL ES 2.0.24] section 4.4 page 105.
    10 #ifndef LIBGLESV2_FRAMEBUFFER_H_
    11 #define LIBGLESV2_FRAMEBUFFER_H_
    13 #include "common/angleutils.h"
    14 #include "common/RefCountObject.h"
    15 #include "Constants.h"
    17 namespace rx
    18 {
    19 class Renderer;
    20 }
    22 namespace gl
    23 {
    24 class Renderbuffer;
    25 class Colorbuffer;
    26 class Depthbuffer;
    27 class Stencilbuffer;
    28 class DepthStencilbuffer;
    30 class Framebuffer
    31 {
    32   public:
    33     explicit Framebuffer(rx::Renderer *renderer);
    35     virtual ~Framebuffer();
    37     void setColorbuffer(unsigned int colorAttachment, GLenum type, GLuint colorbuffer);
    38     void setDepthbuffer(GLenum type, GLuint depthbuffer);
    39     void setStencilbuffer(GLenum type, GLuint stencilbuffer);
    41     void detachTexture(GLuint texture);
    42     void detachRenderbuffer(GLuint renderbuffer);
    44     unsigned int getRenderTargetSerial(unsigned int colorAttachment) const;
    45     unsigned int getDepthbufferSerial() const;
    46     unsigned int getStencilbufferSerial() const;
    48     Renderbuffer *getColorbuffer(unsigned int colorAttachment) const;
    49     Renderbuffer *getDepthbuffer() const;
    50     Renderbuffer *getStencilbuffer() const;
    51     Renderbuffer *getDepthOrStencilbuffer() const;
    52     Renderbuffer *getReadColorbuffer() const;
    53     GLenum getReadColorbufferType() const;
    54     Renderbuffer *getFirstColorbuffer() const;
    56     GLenum getColorbufferType(unsigned int colorAttachment) const;
    57     GLenum getDepthbufferType() const;
    58     GLenum getStencilbufferType() const;
    60     GLuint getColorbufferHandle(unsigned int colorAttachment) const;
    61     GLuint getDepthbufferHandle() const;
    62     GLuint getStencilbufferHandle() const;
    64     GLenum getDrawBufferState(unsigned int colorAttachment) const;
    65     void setDrawBufferState(unsigned int colorAttachment, GLenum drawBuffer);
    67     bool isEnabledColorAttachment(unsigned int colorAttachment) const;
    68     bool hasEnabledColorAttachment() const;
    69     bool hasStencil() const;
    70     int getSamples() const;
    71     bool usingExtendedDrawBuffers() const;
    73     virtual GLenum completeness() const;
    75   protected:
    76     GLenum mColorbufferTypes[IMPLEMENTATION_MAX_DRAW_BUFFERS];
    77     BindingPointer<Renderbuffer> mColorbufferPointers[IMPLEMENTATION_MAX_DRAW_BUFFERS];
    78     GLenum mDrawBufferStates[IMPLEMENTATION_MAX_DRAW_BUFFERS];
    79     GLenum mReadBufferState;
    81     GLenum mDepthbufferType;
    82     BindingPointer<Renderbuffer> mDepthbufferPointer;
    84     GLenum mStencilbufferType;
    85     BindingPointer<Renderbuffer> mStencilbufferPointer;
    87     rx::Renderer *mRenderer;
    89   private:
    90     DISALLOW_COPY_AND_ASSIGN(Framebuffer);
    92     Renderbuffer *lookupRenderbuffer(GLenum type, GLuint handle) const;
    93 };
    95 class DefaultFramebuffer : public Framebuffer
    96 {
    97   public:
    98     DefaultFramebuffer(rx::Renderer *Renderer, Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil);
   100     virtual GLenum completeness() const;
   102   private:
   103     DISALLOW_COPY_AND_ASSIGN(DefaultFramebuffer);
   104 };
   106 }
   108 #endif   // LIBGLESV2_FRAMEBUFFER_H_

mercurial