gfx/angle/src/libGLESv2/renderer/TextureStorage.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-2012 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 // TextureStorage.h: Defines the abstract rx::TextureStorageInterface class and its concrete derived
     8 // classes TextureStorageInterface2D and TextureStorageInterfaceCube, which act as the interface to the
     9 // GPU-side texture.
    11 #ifndef LIBGLESV2_RENDERER_TEXTURESTORAGE_H_
    12 #define LIBGLESV2_RENDERER_TEXTURESTORAGE_H_
    14 #include "common/debug.h"
    16 namespace rx
    17 {
    18 class Renderer;
    19 class SwapChain;
    20 class RenderTarget;
    21 class Blit;
    23 class TextureStorage
    24 {
    25   public:
    26     TextureStorage() {};
    27     virtual ~TextureStorage() {};
    29     virtual int getLodOffset() const = 0;
    30     virtual bool isRenderTarget() const = 0;
    31     virtual bool isManaged() const = 0;
    32     virtual int levelCount() = 0;
    34     virtual RenderTarget *getRenderTarget() = 0;
    35     virtual RenderTarget *getRenderTarget(GLenum faceTarget) = 0;
    36     virtual void generateMipmap(int level) = 0;
    37     virtual void generateMipmap(int face, int level) = 0;
    39   private:
    40     DISALLOW_COPY_AND_ASSIGN(TextureStorage);
    42 };
    44 class TextureStorageInterface
    45 {
    46   public:
    47     TextureStorageInterface();
    48     virtual ~TextureStorageInterface();
    50     TextureStorage *getStorageInstance() { return mInstance; }
    52     unsigned int getTextureSerial() const;
    53     virtual unsigned int getRenderTargetSerial(GLenum target) const = 0;
    55     virtual int getLodOffset() const;
    56     virtual bool isRenderTarget() const;
    57     virtual bool isManaged() const;
    58     virtual int levelCount();
    60   protected:
    61     TextureStorage *mInstance;
    63   private:
    64     DISALLOW_COPY_AND_ASSIGN(TextureStorageInterface);
    66     const unsigned int mTextureSerial;
    67     static unsigned int issueTextureSerial();
    69     static unsigned int mCurrentTextureSerial;
    70 };
    72 class TextureStorageInterface2D : public TextureStorageInterface
    73 {
    74   public:
    75     TextureStorageInterface2D(Renderer *renderer, SwapChain *swapchain);
    76     TextureStorageInterface2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height);
    77     virtual ~TextureStorageInterface2D();
    79     void generateMipmap(int level);
    80     RenderTarget *getRenderTarget() const;
    82     virtual unsigned int getRenderTargetSerial(GLenum target) const;
    84   private:
    85     DISALLOW_COPY_AND_ASSIGN(TextureStorageInterface2D);
    87     const unsigned int mRenderTargetSerial;
    88 };
    90 class TextureStorageInterfaceCube : public TextureStorageInterface
    91 {
    92   public:
    93     TextureStorageInterfaceCube(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size);
    94     virtual ~TextureStorageInterfaceCube();
    96     void generateMipmap(int face, int level);
    97     RenderTarget *getRenderTarget(GLenum faceTarget) const;
    99     virtual unsigned int getRenderTargetSerial(GLenum target) const;
   101   private:
   102     DISALLOW_COPY_AND_ASSIGN(TextureStorageInterfaceCube);
   104     const unsigned int mFirstRenderTargetSerial;
   105 };
   107 }
   109 #endif // LIBGLESV2_RENDERER_TEXTURESTORAGE_H_

mercurial