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.

michael@0 1 //
michael@0 2 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
michael@0 3 // Use of this source code is governed by a BSD-style license that can be
michael@0 4 // found in the LICENSE file.
michael@0 5 //
michael@0 6
michael@0 7 // TextureStorage9.h: Defines the abstract rx::TextureStorage9 class and its concrete derived
michael@0 8 // classes TextureStorage9_2D and TextureStorage9_Cube, which act as the interface to the
michael@0 9 // D3D9 texture.
michael@0 10
michael@0 11 #ifndef LIBGLESV2_RENDERER_TEXTURESTORAGE9_H_
michael@0 12 #define LIBGLESV2_RENDERER_TEXTURESTORAGE9_H_
michael@0 13
michael@0 14 #include "libGLESv2/renderer/TextureStorage.h"
michael@0 15 #include "common/debug.h"
michael@0 16
michael@0 17 namespace rx
michael@0 18 {
michael@0 19 class Renderer9;
michael@0 20 class SwapChain9;
michael@0 21 class RenderTarget;
michael@0 22 class RenderTarget9;
michael@0 23 class Blit;
michael@0 24
michael@0 25 class TextureStorage9 : public TextureStorage
michael@0 26 {
michael@0 27 public:
michael@0 28 TextureStorage9(Renderer *renderer, DWORD usage);
michael@0 29 virtual ~TextureStorage9();
michael@0 30
michael@0 31 static TextureStorage9 *makeTextureStorage9(TextureStorage *storage);
michael@0 32
michael@0 33 static DWORD GetTextureUsage(D3DFORMAT d3dfmt, GLenum glusage, bool forceRenderable);
michael@0 34 static bool IsTextureFormatRenderable(D3DFORMAT format);
michael@0 35
michael@0 36 D3DPOOL getPool() const;
michael@0 37 DWORD getUsage() const;
michael@0 38
michael@0 39 virtual IDirect3DBaseTexture9 *getBaseTexture() const = 0;
michael@0 40 virtual RenderTarget *getRenderTarget() { return NULL; }
michael@0 41 virtual RenderTarget *getRenderTarget(GLenum faceTarget) { return NULL; }
michael@0 42 virtual void generateMipmap(int level) {};
michael@0 43 virtual void generateMipmap(int face, int level) {};
michael@0 44
michael@0 45 virtual int getLodOffset() const;
michael@0 46 virtual bool isRenderTarget() const;
michael@0 47 virtual bool isManaged() const;
michael@0 48 virtual int levelCount();
michael@0 49
michael@0 50 protected:
michael@0 51 int mLodOffset;
michael@0 52 Renderer9 *mRenderer;
michael@0 53
michael@0 54 private:
michael@0 55 DISALLOW_COPY_AND_ASSIGN(TextureStorage9);
michael@0 56
michael@0 57 const DWORD mD3DUsage;
michael@0 58 const D3DPOOL mD3DPool;
michael@0 59 };
michael@0 60
michael@0 61 class TextureStorage9_2D : public TextureStorage9
michael@0 62 {
michael@0 63 public:
michael@0 64 TextureStorage9_2D(Renderer *renderer, SwapChain9 *swapchain);
michael@0 65 TextureStorage9_2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height);
michael@0 66 virtual ~TextureStorage9_2D();
michael@0 67
michael@0 68 static TextureStorage9_2D *makeTextureStorage9_2D(TextureStorage *storage);
michael@0 69
michael@0 70 IDirect3DSurface9 *getSurfaceLevel(int level, bool dirty);
michael@0 71 virtual RenderTarget *getRenderTarget();
michael@0 72 virtual IDirect3DBaseTexture9 *getBaseTexture() const;
michael@0 73 virtual void generateMipmap(int level);
michael@0 74
michael@0 75 private:
michael@0 76 DISALLOW_COPY_AND_ASSIGN(TextureStorage9_2D);
michael@0 77
michael@0 78 void initializeRenderTarget();
michael@0 79
michael@0 80 IDirect3DTexture9 *mTexture;
michael@0 81 RenderTarget9 *mRenderTarget;
michael@0 82 };
michael@0 83
michael@0 84 class TextureStorage9_Cube : public TextureStorage9
michael@0 85 {
michael@0 86 public:
michael@0 87 TextureStorage9_Cube(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size);
michael@0 88 virtual ~TextureStorage9_Cube();
michael@0 89
michael@0 90 static TextureStorage9_Cube *makeTextureStorage9_Cube(TextureStorage *storage);
michael@0 91
michael@0 92 IDirect3DSurface9 *getCubeMapSurface(GLenum faceTarget, int level, bool dirty);
michael@0 93 virtual RenderTarget *getRenderTarget(GLenum faceTarget);
michael@0 94 virtual IDirect3DBaseTexture9 *getBaseTexture() const;
michael@0 95 virtual void generateMipmap(int face, int level);
michael@0 96
michael@0 97 private:
michael@0 98 DISALLOW_COPY_AND_ASSIGN(TextureStorage9_Cube);
michael@0 99
michael@0 100 void initializeRenderTarget();
michael@0 101
michael@0 102 IDirect3DCubeTexture9 *mTexture;
michael@0 103 RenderTarget9 *mRenderTarget[6];
michael@0 104 };
michael@0 105
michael@0 106 }
michael@0 107
michael@0 108 #endif // LIBGLESV2_RENDERER_TEXTURESTORAGE9_H_
michael@0 109

mercurial