gfx/angle/angle-default-clamp-strat.patch

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 From: Jeff Gilbert <jgilbert@mozilla.com>
     3 diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp
     4 --- a/gfx/angle/src/compiler/Compiler.cpp
     5 +++ b/gfx/angle/src/compiler/Compiler.cpp
     6 @@ -130,18 +130,21 @@ bool TCompiler::Init(const ShBuiltInReso
     7      TScopedPoolAllocator scopedAlloc(&allocator, false);
     9      // Generate built-in symbol table.
    10      if (!InitBuiltInSymbolTable(resources))
    11          return false;
    12      InitExtensionBehavior(resources, extensionBehavior);
    13      fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
    15 -    arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy);
    16 -    clampingStrategy = resources.ArrayIndexClampingStrategy;
    17 +    // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'.
    18 +    if (resources.ArrayIndexClampingStrategy) {
    19 +        clampingStrategy = resources.ArrayIndexClampingStrategy;
    20 +    }
    21 +    arrayBoundsClamper.SetClampingStrategy(clampingStrategy);
    23      hashFunction = resources.HashFunction;
    25      return true;
    26  }
    28  bool TCompiler::compile(const char* const shaderStrings[],
    29                          size_t numStrings,
    30 diff --git a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
    31 --- a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
    32 +++ b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
    33 @@ -72,16 +72,19 @@ private:
    34  ArrayBoundsClamper::ArrayBoundsClamper()
    35      : mClampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC)
    36      , mArrayBoundsClampDefinitionNeeded(false)
    37  {
    38  }
    40  void ArrayBoundsClamper::SetClampingStrategy(ShArrayIndexClampingStrategy clampingStrategy)
    41  {
    42 +    ASSERT(clampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC ||
    43 +           clampingStrategy == SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION);
    44 +
    45      mClampingStrategy = clampingStrategy;
    46  }
    48  void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root)
    49  {
    50      ASSERT(root);
    52      ArrayBoundsClamperMarker clamper;

mercurial