Sat, 03 Jan 2015 20:18:00 +0100
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) 2002-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 | // TextureStorage.h: Defines the abstract rx::TextureStorageInterface class and its concrete derived |
michael@0 | 8 | // classes TextureStorageInterface2D and TextureStorageInterfaceCube, which act as the interface to the |
michael@0 | 9 | // GPU-side texture. |
michael@0 | 10 | |
michael@0 | 11 | #ifndef LIBGLESV2_RENDERER_TEXTURESTORAGE_H_ |
michael@0 | 12 | #define LIBGLESV2_RENDERER_TEXTURESTORAGE_H_ |
michael@0 | 13 | |
michael@0 | 14 | #include "common/debug.h" |
michael@0 | 15 | |
michael@0 | 16 | namespace rx |
michael@0 | 17 | { |
michael@0 | 18 | class Renderer; |
michael@0 | 19 | class SwapChain; |
michael@0 | 20 | class RenderTarget; |
michael@0 | 21 | class Blit; |
michael@0 | 22 | |
michael@0 | 23 | class TextureStorage |
michael@0 | 24 | { |
michael@0 | 25 | public: |
michael@0 | 26 | TextureStorage() {}; |
michael@0 | 27 | virtual ~TextureStorage() {}; |
michael@0 | 28 | |
michael@0 | 29 | virtual int getLodOffset() const = 0; |
michael@0 | 30 | virtual bool isRenderTarget() const = 0; |
michael@0 | 31 | virtual bool isManaged() const = 0; |
michael@0 | 32 | virtual int levelCount() = 0; |
michael@0 | 33 | |
michael@0 | 34 | virtual RenderTarget *getRenderTarget() = 0; |
michael@0 | 35 | virtual RenderTarget *getRenderTarget(GLenum faceTarget) = 0; |
michael@0 | 36 | virtual void generateMipmap(int level) = 0; |
michael@0 | 37 | virtual void generateMipmap(int face, int level) = 0; |
michael@0 | 38 | |
michael@0 | 39 | private: |
michael@0 | 40 | DISALLOW_COPY_AND_ASSIGN(TextureStorage); |
michael@0 | 41 | |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | class TextureStorageInterface |
michael@0 | 45 | { |
michael@0 | 46 | public: |
michael@0 | 47 | TextureStorageInterface(); |
michael@0 | 48 | virtual ~TextureStorageInterface(); |
michael@0 | 49 | |
michael@0 | 50 | TextureStorage *getStorageInstance() { return mInstance; } |
michael@0 | 51 | |
michael@0 | 52 | unsigned int getTextureSerial() const; |
michael@0 | 53 | virtual unsigned int getRenderTargetSerial(GLenum target) const = 0; |
michael@0 | 54 | |
michael@0 | 55 | virtual int getLodOffset() const; |
michael@0 | 56 | virtual bool isRenderTarget() const; |
michael@0 | 57 | virtual bool isManaged() const; |
michael@0 | 58 | virtual int levelCount(); |
michael@0 | 59 | |
michael@0 | 60 | protected: |
michael@0 | 61 | TextureStorage *mInstance; |
michael@0 | 62 | |
michael@0 | 63 | private: |
michael@0 | 64 | DISALLOW_COPY_AND_ASSIGN(TextureStorageInterface); |
michael@0 | 65 | |
michael@0 | 66 | const unsigned int mTextureSerial; |
michael@0 | 67 | static unsigned int issueTextureSerial(); |
michael@0 | 68 | |
michael@0 | 69 | static unsigned int mCurrentTextureSerial; |
michael@0 | 70 | }; |
michael@0 | 71 | |
michael@0 | 72 | class TextureStorageInterface2D : public TextureStorageInterface |
michael@0 | 73 | { |
michael@0 | 74 | public: |
michael@0 | 75 | TextureStorageInterface2D(Renderer *renderer, SwapChain *swapchain); |
michael@0 | 76 | TextureStorageInterface2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height); |
michael@0 | 77 | virtual ~TextureStorageInterface2D(); |
michael@0 | 78 | |
michael@0 | 79 | void generateMipmap(int level); |
michael@0 | 80 | RenderTarget *getRenderTarget() const; |
michael@0 | 81 | |
michael@0 | 82 | virtual unsigned int getRenderTargetSerial(GLenum target) const; |
michael@0 | 83 | |
michael@0 | 84 | private: |
michael@0 | 85 | DISALLOW_COPY_AND_ASSIGN(TextureStorageInterface2D); |
michael@0 | 86 | |
michael@0 | 87 | const unsigned int mRenderTargetSerial; |
michael@0 | 88 | }; |
michael@0 | 89 | |
michael@0 | 90 | class TextureStorageInterfaceCube : public TextureStorageInterface |
michael@0 | 91 | { |
michael@0 | 92 | public: |
michael@0 | 93 | TextureStorageInterfaceCube(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size); |
michael@0 | 94 | virtual ~TextureStorageInterfaceCube(); |
michael@0 | 95 | |
michael@0 | 96 | void generateMipmap(int face, int level); |
michael@0 | 97 | RenderTarget *getRenderTarget(GLenum faceTarget) const; |
michael@0 | 98 | |
michael@0 | 99 | virtual unsigned int getRenderTargetSerial(GLenum target) const; |
michael@0 | 100 | |
michael@0 | 101 | private: |
michael@0 | 102 | DISALLOW_COPY_AND_ASSIGN(TextureStorageInterfaceCube); |
michael@0 | 103 | |
michael@0 | 104 | const unsigned int mFirstRenderTargetSerial; |
michael@0 | 105 | }; |
michael@0 | 106 | |
michael@0 | 107 | } |
michael@0 | 108 | |
michael@0 | 109 | #endif // LIBGLESV2_RENDERER_TEXTURESTORAGE_H_ |
michael@0 | 110 |