gfx/angle/src/libGLESv2/renderer/VertexDeclarationCache.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 // VertexDeclarationCache.h: Defines a helper class to construct and cache vertex declarations.
     9 #ifndef LIBGLESV2_RENDERER_VERTEXDECLARATIONCACHE_H_
    10 #define LIBGLESV2_RENDERER_VERTEXDECLARATIONCACHE_H_
    12 #include "libGLESv2/renderer/VertexDataManager.h"
    14 namespace gl
    15 {
    16 class VertexDataManager;
    17 }
    19 namespace rx
    20 {
    22 class VertexDeclarationCache
    23 {
    24   public:
    25     VertexDeclarationCache();
    26     ~VertexDeclarationCache();
    28     GLenum applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], gl::ProgramBinary *programBinary, GLsizei instances, GLsizei *repeatDraw);
    30     void markStateDirty();
    32   private:
    33     UINT mMaxLru;
    35     enum { NUM_VERTEX_DECL_CACHE_ENTRIES = 32 };
    37     struct VBData
    38     {
    39         unsigned int serial;
    40         unsigned int stride;
    41         unsigned int offset;
    42     };
    44     VBData mAppliedVBs[gl::MAX_VERTEX_ATTRIBS];
    45     IDirect3DVertexDeclaration9 *mLastSetVDecl;
    46     bool mInstancingEnabled;
    48     struct VertexDeclCacheEntry
    49     {
    50         D3DVERTEXELEMENT9 cachedElements[gl::MAX_VERTEX_ATTRIBS + 1];
    51         UINT lruCount;
    52         IDirect3DVertexDeclaration9 *vertexDeclaration;
    53     } mVertexDeclCache[NUM_VERTEX_DECL_CACHE_ENTRIES];
    54 };
    56 }
    58 #endif // LIBGLESV2_RENDERER_VERTEXDECLARATIONCACHE_H_

mercurial