gfx/angle/src/compiler/VariablePacker.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) 2002-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 #ifndef _VARIABLEPACKER_INCLUDED_
     8 #define _VARIABLEPACKER_INCLUDED_
    10 #include <vector>
    11 #include "compiler/ShHandle.h"
    13 class VariablePacker {
    14  public:
    15     // Returns true if the passed in variables pack in maxVectors following
    16     // the packing rules from the GLSL 1.017 spec, Appendix A, section 7.
    17     bool CheckVariablesWithinPackingLimits(
    18         int maxVectors,
    19         const TVariableInfoList& in_variables);
    21     // Gets how many components in a row a data type takes.
    22     static int GetNumComponentsPerRow(ShDataType type);
    24     // Gets how many rows a data type takes.
    25     static int GetNumRows(ShDataType type);
    27  private:
    28     static const int kNumColumns = 4;
    29     static const unsigned kColumnMask = (1 << kNumColumns) - 1;
    31     unsigned makeColumnFlags(int column, int numComponentsPerRow);
    32     void fillColumns(int topRow, int numRows, int column, int numComponentsPerRow);
    33     bool searchColumn(int column, int numRows, int* destRow, int* destSize);
    35     int topNonFullRow_;
    36     int bottomNonFullRow_;
    37     int maxRows_;
    38     std::vector<unsigned> rows_;
    39 };
    41 #endif // _VARIABLEPACKER_INCLUDED_

mercurial