gfx/angle/src/libGLESv2/renderer/TextureStorage9.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) 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 // TextureStorage9.h: Defines the abstract rx::TextureStorage9 class and its concrete derived
     8 // classes TextureStorage9_2D and TextureStorage9_Cube, which act as the interface to the
     9 // D3D9 texture.
    11 #ifndef LIBGLESV2_RENDERER_TEXTURESTORAGE9_H_
    12 #define LIBGLESV2_RENDERER_TEXTURESTORAGE9_H_
    14 #include "libGLESv2/renderer/TextureStorage.h"
    15 #include "common/debug.h"
    17 namespace rx
    18 {
    19 class Renderer9;
    20 class SwapChain9;
    21 class RenderTarget;
    22 class RenderTarget9;
    23 class Blit;
    25 class TextureStorage9 : public TextureStorage
    26 {
    27   public:
    28     TextureStorage9(Renderer *renderer, DWORD usage);
    29     virtual ~TextureStorage9();
    31     static TextureStorage9 *makeTextureStorage9(TextureStorage *storage);
    33     static DWORD GetTextureUsage(D3DFORMAT d3dfmt, GLenum glusage, bool forceRenderable);
    34     static bool IsTextureFormatRenderable(D3DFORMAT format);
    36     D3DPOOL getPool() const;
    37     DWORD getUsage() const;
    39     virtual IDirect3DBaseTexture9 *getBaseTexture() const = 0;
    40     virtual RenderTarget *getRenderTarget() { return NULL; }
    41     virtual RenderTarget *getRenderTarget(GLenum faceTarget) { return NULL; }
    42     virtual void generateMipmap(int level) {};
    43     virtual void generateMipmap(int face, int level) {};
    45     virtual int getLodOffset() const;
    46     virtual bool isRenderTarget() const;
    47     virtual bool isManaged() const;
    48     virtual int levelCount();
    50   protected:
    51     int mLodOffset;
    52     Renderer9 *mRenderer;
    54   private:
    55     DISALLOW_COPY_AND_ASSIGN(TextureStorage9);
    57     const DWORD mD3DUsage;
    58     const D3DPOOL mD3DPool;
    59 };
    61 class TextureStorage9_2D : public TextureStorage9
    62 {
    63   public:
    64     TextureStorage9_2D(Renderer *renderer, SwapChain9 *swapchain);
    65     TextureStorage9_2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height);
    66     virtual ~TextureStorage9_2D();
    68     static TextureStorage9_2D *makeTextureStorage9_2D(TextureStorage *storage);
    70     IDirect3DSurface9 *getSurfaceLevel(int level, bool dirty);
    71     virtual RenderTarget *getRenderTarget();
    72     virtual IDirect3DBaseTexture9 *getBaseTexture() const;
    73     virtual void generateMipmap(int level);
    75   private:
    76     DISALLOW_COPY_AND_ASSIGN(TextureStorage9_2D);
    78     void initializeRenderTarget();
    80     IDirect3DTexture9 *mTexture;
    81     RenderTarget9 *mRenderTarget;
    82 };
    84 class TextureStorage9_Cube : public TextureStorage9
    85 {
    86   public:
    87     TextureStorage9_Cube(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size);
    88     virtual ~TextureStorage9_Cube();
    90     static TextureStorage9_Cube *makeTextureStorage9_Cube(TextureStorage *storage);
    92     IDirect3DSurface9 *getCubeMapSurface(GLenum faceTarget, int level, bool dirty);
    93     virtual RenderTarget *getRenderTarget(GLenum faceTarget);
    94     virtual IDirect3DBaseTexture9 *getBaseTexture() const;
    95     virtual void generateMipmap(int face, int level);
    97   private:
    98     DISALLOW_COPY_AND_ASSIGN(TextureStorage9_Cube);
   100     void initializeRenderTarget();
   102     IDirect3DCubeTexture9 *mTexture;
   103     RenderTarget9 *mRenderTarget[6];
   104 };
   106 }
   108 #endif // LIBGLESV2_RENDERER_TEXTURESTORAGE9_H_

mercurial