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 | // renderer11_utils.h: Conversion functions and other utility routines |
michael@0 | 8 | // specific to the D3D11 renderer. |
michael@0 | 9 | |
michael@0 | 10 | #ifndef LIBGLESV2_RENDERER_RENDERER11_UTILS_H |
michael@0 | 11 | #define LIBGLESV2_RENDERER_RENDERER11_UTILS_H |
michael@0 | 12 | |
michael@0 | 13 | #include "libGLESv2/angletypes.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace gl_d3d11 |
michael@0 | 16 | { |
michael@0 | 17 | |
michael@0 | 18 | D3D11_BLEND ConvertBlendFunc(GLenum glBlend, bool isAlpha); |
michael@0 | 19 | D3D11_BLEND_OP ConvertBlendOp(GLenum glBlendOp); |
michael@0 | 20 | UINT8 ConvertColorMask(bool maskRed, bool maskGreen, bool maskBlue, bool maskAlpha); |
michael@0 | 21 | |
michael@0 | 22 | D3D11_CULL_MODE ConvertCullMode(bool cullEnabled, GLenum cullMode); |
michael@0 | 23 | |
michael@0 | 24 | D3D11_COMPARISON_FUNC ConvertComparison(GLenum comparison); |
michael@0 | 25 | D3D11_DEPTH_WRITE_MASK ConvertDepthMask(bool depthWriteEnabled); |
michael@0 | 26 | UINT8 ConvertStencilMask(GLuint stencilmask); |
michael@0 | 27 | D3D11_STENCIL_OP ConvertStencilOp(GLenum stencilOp); |
michael@0 | 28 | |
michael@0 | 29 | D3D11_FILTER ConvertFilter(GLenum minFilter, GLenum magFilter, float maxAnisotropy); |
michael@0 | 30 | D3D11_TEXTURE_ADDRESS_MODE ConvertTextureWrap(GLenum wrap); |
michael@0 | 31 | FLOAT ConvertMinLOD(GLenum minFilter, unsigned int lodOffset); |
michael@0 | 32 | FLOAT ConvertMaxLOD(GLenum minFilter, unsigned int lodOffset); |
michael@0 | 33 | |
michael@0 | 34 | DXGI_FORMAT ConvertRenderbufferFormat(GLenum format); |
michael@0 | 35 | DXGI_FORMAT ConvertTextureFormat(GLenum format); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | namespace d3d11_gl |
michael@0 | 39 | { |
michael@0 | 40 | |
michael@0 | 41 | GLenum ConvertBackBufferFormat(DXGI_FORMAT format); |
michael@0 | 42 | GLenum ConvertDepthStencilFormat(DXGI_FORMAT format); |
michael@0 | 43 | GLenum ConvertRenderbufferFormat(DXGI_FORMAT format); |
michael@0 | 44 | GLenum ConvertTextureInternalFormat(DXGI_FORMAT format); |
michael@0 | 45 | |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | namespace d3d11 |
michael@0 | 49 | { |
michael@0 | 50 | |
michael@0 | 51 | struct PositionTexCoordVertex |
michael@0 | 52 | { |
michael@0 | 53 | float x, y; |
michael@0 | 54 | float u, v; |
michael@0 | 55 | }; |
michael@0 | 56 | void SetPositionTexCoordVertex(PositionTexCoordVertex* vertex, float x, float y, float u, float v); |
michael@0 | 57 | |
michael@0 | 58 | struct PositionDepthColorVertex |
michael@0 | 59 | { |
michael@0 | 60 | float x, y, z; |
michael@0 | 61 | float r, g, b, a; |
michael@0 | 62 | }; |
michael@0 | 63 | void SetPositionDepthColorVertex(PositionDepthColorVertex* vertex, float x, float y, float z, |
michael@0 | 64 | const gl::Color &color); |
michael@0 | 65 | |
michael@0 | 66 | size_t ComputePixelSizeBits(DXGI_FORMAT format); |
michael@0 | 67 | size_t ComputeBlockSizeBits(DXGI_FORMAT format); |
michael@0 | 68 | |
michael@0 | 69 | bool IsCompressed(DXGI_FORMAT format); |
michael@0 | 70 | unsigned int GetTextureFormatDimensionAlignment(DXGI_FORMAT format); |
michael@0 | 71 | |
michael@0 | 72 | bool IsDepthStencilFormat(DXGI_FORMAT format); |
michael@0 | 73 | DXGI_FORMAT GetDepthTextureFormat(DXGI_FORMAT format); |
michael@0 | 74 | DXGI_FORMAT GetDepthShaderResourceFormat(DXGI_FORMAT format); |
michael@0 | 75 | |
michael@0 | 76 | HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name); |
michael@0 | 77 | |
michael@0 | 78 | inline bool isDeviceLostError(HRESULT errorCode) |
michael@0 | 79 | { |
michael@0 | 80 | switch (errorCode) |
michael@0 | 81 | { |
michael@0 | 82 | case DXGI_ERROR_DEVICE_HUNG: |
michael@0 | 83 | case DXGI_ERROR_DEVICE_REMOVED: |
michael@0 | 84 | case DXGI_ERROR_DEVICE_RESET: |
michael@0 | 85 | case DXGI_ERROR_DRIVER_INTERNAL_ERROR: |
michael@0 | 86 | case DXGI_ERROR_NOT_CURRENTLY_AVAILABLE: |
michael@0 | 87 | return true; |
michael@0 | 88 | default: |
michael@0 | 89 | return false; |
michael@0 | 90 | } |
michael@0 | 91 | } |
michael@0 | 92 | |
michael@0 | 93 | } |
michael@0 | 94 | |
michael@0 | 95 | #endif // LIBGLESV2_RENDERER_RENDERER11_UTILS_H |