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) 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 | // VertexBuffer11.h: Defines the D3D11 VertexBuffer implementation. |
michael@0 | 8 | |
michael@0 | 9 | #ifndef LIBGLESV2_RENDERER_VERTEXBUFFER11_H_ |
michael@0 | 10 | #define LIBGLESV2_RENDERER_VERTEXBUFFER11_H_ |
michael@0 | 11 | |
michael@0 | 12 | #include "libGLESv2/renderer/VertexBuffer.h" |
michael@0 | 13 | |
michael@0 | 14 | namespace rx |
michael@0 | 15 | { |
michael@0 | 16 | class Renderer11; |
michael@0 | 17 | |
michael@0 | 18 | class VertexBuffer11 : public VertexBuffer |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | explicit VertexBuffer11(rx::Renderer11 *const renderer); |
michael@0 | 22 | virtual ~VertexBuffer11(); |
michael@0 | 23 | |
michael@0 | 24 | virtual bool initialize(unsigned int size, bool dynamicUsage); |
michael@0 | 25 | |
michael@0 | 26 | static VertexBuffer11 *makeVertexBuffer11(VertexBuffer *vetexBuffer); |
michael@0 | 27 | |
michael@0 | 28 | virtual bool storeVertexAttributes(const gl::VertexAttribute &attrib, GLint start, GLsizei count, GLsizei instances, |
michael@0 | 29 | unsigned int offset); |
michael@0 | 30 | virtual bool storeRawData(const void* data, unsigned int size, unsigned int offset); |
michael@0 | 31 | |
michael@0 | 32 | virtual bool getSpaceRequired(const gl::VertexAttribute &attrib, GLsizei count, GLsizei instances, |
michael@0 | 33 | unsigned int *outSpaceRequired) const; |
michael@0 | 34 | |
michael@0 | 35 | virtual bool requiresConversion(const gl::VertexAttribute &attrib) const; |
michael@0 | 36 | |
michael@0 | 37 | virtual unsigned int getBufferSize() const; |
michael@0 | 38 | virtual bool setBufferSize(unsigned int size); |
michael@0 | 39 | virtual bool discard(); |
michael@0 | 40 | |
michael@0 | 41 | unsigned int getVertexSize(const gl::VertexAttribute &attrib) const; |
michael@0 | 42 | DXGI_FORMAT getDXGIFormat(const gl::VertexAttribute &attrib) const; |
michael@0 | 43 | |
michael@0 | 44 | ID3D11Buffer *getBuffer() const; |
michael@0 | 45 | |
michael@0 | 46 | private: |
michael@0 | 47 | DISALLOW_COPY_AND_ASSIGN(VertexBuffer11); |
michael@0 | 48 | |
michael@0 | 49 | rx::Renderer11 *const mRenderer; |
michael@0 | 50 | |
michael@0 | 51 | ID3D11Buffer *mBuffer; |
michael@0 | 52 | unsigned int mBufferSize; |
michael@0 | 53 | bool mDynamicUsage; |
michael@0 | 54 | |
michael@0 | 55 | typedef void (*VertexConversionFunction)(const void *, unsigned int, unsigned int, void *); |
michael@0 | 56 | struct VertexConverter |
michael@0 | 57 | { |
michael@0 | 58 | VertexConversionFunction conversionFunc; |
michael@0 | 59 | bool identity; |
michael@0 | 60 | DXGI_FORMAT dxgiFormat; |
michael@0 | 61 | unsigned int outputElementSize; |
michael@0 | 62 | }; |
michael@0 | 63 | |
michael@0 | 64 | enum { NUM_GL_VERTEX_ATTRIB_TYPES = 6 }; |
michael@0 | 65 | |
michael@0 | 66 | // This table is used to generate mAttributeTypes. |
michael@0 | 67 | static const VertexConverter mPossibleTranslations[NUM_GL_VERTEX_ATTRIB_TYPES][2][4]; // [GL types as enumerated by typeIndex()][normalized][size - 1] |
michael@0 | 68 | |
michael@0 | 69 | static const VertexConverter &getVertexConversion(const gl::VertexAttribute &attribute); |
michael@0 | 70 | }; |
michael@0 | 71 | |
michael@0 | 72 | } |
michael@0 | 73 | |
michael@0 | 74 | #endif // LIBGLESV2_RENDERER_VERTEXBUFFER11_H_ |