Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | From: Jacek Caban <jacek@codeweavers.com> |
michael@0 | 2 | Bug 945292 - Fixed ANGLE compilation on mingw. |
michael@0 | 3 | |
michael@0 | 4 | |
michael@0 | 5 | diff --git a/gfx/angle/src/common/debug.h b/gfx/angle/src/common/debug.h |
michael@0 | 6 | index 23ee26d..060b727 100644 |
michael@0 | 7 | --- a/gfx/angle/src/common/debug.h |
michael@0 | 8 | +++ b/gfx/angle/src/common/debug.h |
michael@0 | 9 | @@ -94,18 +94,20 @@ namespace gl |
michael@0 | 10 | #define UNREACHABLE() do { \ |
michael@0 | 11 | ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \ |
michael@0 | 12 | assert(false); \ |
michael@0 | 13 | } while(0) |
michael@0 | 14 | #else |
michael@0 | 15 | #define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__) |
michael@0 | 16 | #endif |
michael@0 | 17 | |
michael@0 | 18 | -// A macro that determines whether an object has a given runtime type. |
michael@0 | 19 | -#if !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) |
michael@0 | 20 | +// A macro that determines whether an object has a given runtime type. MSVC uses _CPPRTTI. |
michael@0 | 21 | +// GCC uses __GXX_RTTI, but the macro was introduced in version 4.3, so we assume that all older |
michael@0 | 22 | +// versions support RTTI. |
michael@0 | 23 | +#if !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) && (!defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || defined(__GXX_RTTI)) |
michael@0 | 24 | #define HAS_DYNAMIC_TYPE(type, obj) (dynamic_cast<type >(obj) != NULL) |
michael@0 | 25 | #else |
michael@0 | 26 | #define HAS_DYNAMIC_TYPE(type, obj) true |
michael@0 | 27 | #endif |
michael@0 | 28 | |
michael@0 | 29 | // A macro functioning as a compile-time assert to validate constant conditions |
michael@0 | 30 | #define META_ASSERT(condition) typedef int COMPILE_TIME_ASSERT_##__LINE__[static_cast<bool>(condition)?1:-1] |
michael@0 | 31 | |
michael@0 | 32 | diff --git a/gfx/angle/src/libGLESv2/Constants.h b/gfx/angle/src/libGLESv2/Constants.h |
michael@0 | 33 | new file mode 100644 |
michael@0 | 34 | index 0000000..9f24d66 |
michael@0 | 35 | --- /dev/null |
michael@0 | 36 | +++ b/gfx/angle/src/libGLESv2/Constants.h |
michael@0 | 37 | @@ -0,0 +1,34 @@ |
michael@0 | 38 | +// |
michael@0 | 39 | +// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. |
michael@0 | 40 | +// Use of this source code is governed by a BSD-style license that can be |
michael@0 | 41 | +// found in the LICENSE file. |
michael@0 | 42 | +// |
michael@0 | 43 | + |
michael@0 | 44 | +// Contants.h: Defines some implementation specific and gl constants |
michael@0 | 45 | + |
michael@0 | 46 | +#ifndef LIBGLESV2_CONSTANTS_H_ |
michael@0 | 47 | +#define LIBGLESV2_CONSTANTS_H_ |
michael@0 | 48 | + |
michael@0 | 49 | +namespace gl |
michael@0 | 50 | +{ |
michael@0 | 51 | + |
michael@0 | 52 | +enum |
michael@0 | 53 | +{ |
michael@0 | 54 | + MAX_VERTEX_ATTRIBS = 16, |
michael@0 | 55 | + MAX_TEXTURE_IMAGE_UNITS = 16, |
michael@0 | 56 | + |
michael@0 | 57 | + // Implementation upper limits, real maximums depend on the hardware |
michael@0 | 58 | + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16, |
michael@0 | 59 | + IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS, |
michael@0 | 60 | + |
michael@0 | 61 | + IMPLEMENTATION_MAX_VARYING_VECTORS = 32, |
michael@0 | 62 | + IMPLEMENTATION_MAX_DRAW_BUFFERS = 8 |
michael@0 | 63 | +}; |
michael@0 | 64 | + |
michael@0 | 65 | +const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f; |
michael@0 | 66 | +const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f; |
michael@0 | 67 | +const float ALIASED_POINT_SIZE_RANGE_MIN = 1.0f; |
michael@0 | 68 | + |
michael@0 | 69 | +} |
michael@0 | 70 | + |
michael@0 | 71 | +#endif // LIBGLESV2_CONSTANTS_H_ |
michael@0 | 72 | diff --git a/gfx/angle/src/libGLESv2/Framebuffer.h b/gfx/angle/src/libGLESv2/Framebuffer.h |
michael@0 | 73 | index b54e008..50bfd4f 100644 |
michael@0 | 74 | --- a/gfx/angle/src/libGLESv2/Framebuffer.h |
michael@0 | 75 | +++ b/gfx/angle/src/libGLESv2/Framebuffer.h |
michael@0 | 76 | @@ -7,17 +7,17 @@ |
michael@0 | 77 | // Framebuffer.h: Defines the gl::Framebuffer class. Implements GL framebuffer |
michael@0 | 78 | // objects and related functionality. [OpenGL ES 2.0.24] section 4.4 page 105. |
michael@0 | 79 | |
michael@0 | 80 | #ifndef LIBGLESV2_FRAMEBUFFER_H_ |
michael@0 | 81 | #define LIBGLESV2_FRAMEBUFFER_H_ |
michael@0 | 82 | |
michael@0 | 83 | #include "common/angleutils.h" |
michael@0 | 84 | #include "common/RefCountObject.h" |
michael@0 | 85 | -#include "constants.h" |
michael@0 | 86 | +#include "Constants.h" |
michael@0 | 87 | |
michael@0 | 88 | namespace rx |
michael@0 | 89 | { |
michael@0 | 90 | class Renderer; |
michael@0 | 91 | } |
michael@0 | 92 | |
michael@0 | 93 | namespace gl |
michael@0 | 94 | { |
michael@0 | 95 | diff --git a/gfx/angle/src/libGLESv2/constants.h b/gfx/angle/src/libGLESv2/constants.h |
michael@0 | 96 | deleted file mode 100644 |
michael@0 | 97 | index 9f24d66..0000000 |
michael@0 | 98 | --- a/gfx/angle/src/libGLESv2/constants.h |
michael@0 | 99 | +++ /dev/null |
michael@0 | 100 | @@ -1,34 +0,0 @@ |
michael@0 | 101 | -// |
michael@0 | 102 | -// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. |
michael@0 | 103 | -// Use of this source code is governed by a BSD-style license that can be |
michael@0 | 104 | -// found in the LICENSE file. |
michael@0 | 105 | -// |
michael@0 | 106 | - |
michael@0 | 107 | -// Contants.h: Defines some implementation specific and gl constants |
michael@0 | 108 | - |
michael@0 | 109 | -#ifndef LIBGLESV2_CONSTANTS_H_ |
michael@0 | 110 | -#define LIBGLESV2_CONSTANTS_H_ |
michael@0 | 111 | - |
michael@0 | 112 | -namespace gl |
michael@0 | 113 | -{ |
michael@0 | 114 | - |
michael@0 | 115 | -enum |
michael@0 | 116 | -{ |
michael@0 | 117 | - MAX_VERTEX_ATTRIBS = 16, |
michael@0 | 118 | - MAX_TEXTURE_IMAGE_UNITS = 16, |
michael@0 | 119 | - |
michael@0 | 120 | - // Implementation upper limits, real maximums depend on the hardware |
michael@0 | 121 | - IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16, |
michael@0 | 122 | - IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS, |
michael@0 | 123 | - |
michael@0 | 124 | - IMPLEMENTATION_MAX_VARYING_VECTORS = 32, |
michael@0 | 125 | - IMPLEMENTATION_MAX_DRAW_BUFFERS = 8 |
michael@0 | 126 | -}; |
michael@0 | 127 | - |
michael@0 | 128 | -const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f; |
michael@0 | 129 | -const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f; |
michael@0 | 130 | -const float ALIASED_POINT_SIZE_RANGE_MIN = 1.0f; |
michael@0 | 131 | - |
michael@0 | 132 | -} |
michael@0 | 133 | - |
michael@0 | 134 | -#endif // LIBGLESV2_CONSTANTS_H_ |
michael@0 | 135 | diff --git a/gfx/angle/src/libGLESv2/precompiled.h b/gfx/angle/src/libGLESv2/precompiled.h |
michael@0 | 136 | index f62e71b..58ad181 100644 |
michael@0 | 137 | --- a/gfx/angle/src/libGLESv2/precompiled.h |
michael@0 | 138 | +++ b/gfx/angle/src/libGLESv2/precompiled.h |
michael@0 | 139 | @@ -28,15 +28,15 @@ |
michael@0 | 140 | #include <map> |
michael@0 | 141 | #include <set> |
michael@0 | 142 | #include <sstream> |
michael@0 | 143 | #include <string> |
michael@0 | 144 | #include <unordered_map> |
michael@0 | 145 | #include <vector> |
michael@0 | 146 | |
michael@0 | 147 | #include <d3d9.h> |
michael@0 | 148 | -#include <D3D11.h> |
michael@0 | 149 | +#include <d3d11.h> |
michael@0 | 150 | #include <dxgi.h> |
michael@0 | 151 | #include <d3dcompiler.h> |
michael@0 | 152 | |
michael@0 | 153 | #ifdef _MSC_VER |
michael@0 | 154 | #include <hash_map> |
michael@0 | 155 | #endif |
michael@0 | 156 | diff --git a/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp b/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp |
michael@0 | 157 | index 774cd71..1f2b31d 100644 |
michael@0 | 158 | --- a/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp |
michael@0 | 159 | +++ b/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp |
michael@0 | 160 | @@ -7,17 +7,17 @@ |
michael@0 | 161 | |
michael@0 | 162 | // Renderer11.cpp: Implements a back-end specific class for the D3D11 renderer. |
michael@0 | 163 | |
michael@0 | 164 | #include "libGLESv2/main.h" |
michael@0 | 165 | #include "libGLESv2/utilities.h" |
michael@0 | 166 | #include "libGLESv2/Buffer.h" |
michael@0 | 167 | #include "libGLESv2/ProgramBinary.h" |
michael@0 | 168 | #include "libGLESv2/Framebuffer.h" |
michael@0 | 169 | -#include "libGLESv2/RenderBuffer.h" |
michael@0 | 170 | +#include "libGLESv2/Renderbuffer.h" |
michael@0 | 171 | #include "libGLESv2/renderer/Renderer11.h" |
michael@0 | 172 | #include "libGLESv2/renderer/RenderTarget11.h" |
michael@0 | 173 | #include "libGLESv2/renderer/renderer11_utils.h" |
michael@0 | 174 | #include "libGLESv2/renderer/ShaderExecutable11.h" |
michael@0 | 175 | #include "libGLESv2/renderer/SwapChain11.h" |
michael@0 | 176 | #include "libGLESv2/renderer/Image11.h" |
michael@0 | 177 | #include "libGLESv2/renderer/VertexBuffer11.h" |
michael@0 | 178 | #include "libGLESv2/renderer/IndexBuffer11.h" |
michael@0 | 179 | diff --git a/gfx/angle/src/libGLESv2/renderer/Renderer11.h b/gfx/angle/src/libGLESv2/renderer/Renderer11.h |
michael@0 | 180 | index f024855..90ef04d 100644 |
michael@0 | 181 | --- a/gfx/angle/src/libGLESv2/renderer/Renderer11.h |
michael@0 | 182 | +++ b/gfx/angle/src/libGLESv2/renderer/Renderer11.h |
michael@0 | 183 | @@ -230,17 +230,17 @@ class Renderer11 : public Renderer |
michael@0 | 184 | bool mDepthTextureSupport; |
michael@0 | 185 | |
michael@0 | 186 | // Multisample format support |
michael@0 | 187 | struct MultisampleSupportInfo |
michael@0 | 188 | { |
michael@0 | 189 | unsigned int qualityLevels[D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT]; |
michael@0 | 190 | }; |
michael@0 | 191 | |
michael@0 | 192 | - typedef std::unordered_map<DXGI_FORMAT, MultisampleSupportInfo> MultisampleSupportMap; |
michael@0 | 193 | + typedef std::unordered_map<DXGI_FORMAT, MultisampleSupportInfo, std::hash<int> > MultisampleSupportMap; |
michael@0 | 194 | MultisampleSupportMap mMultisampleSupportMap; |
michael@0 | 195 | |
michael@0 | 196 | unsigned int mMaxSupportedSamples; |
michael@0 | 197 | |
michael@0 | 198 | // current render target states |
michael@0 | 199 | unsigned int mAppliedRenderTargetSerials[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS]; |
michael@0 | 200 | unsigned int mAppliedDepthbufferSerial; |
michael@0 | 201 | unsigned int mAppliedStencilbufferSerial; |