gfx/angle/src/libGLESv2/renderer/renderer9_utils.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.

michael@0 1 //
michael@0 2 // Copyright (c) 2002-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 // renderer9_utils.h: Conversion functions and other utility routines
michael@0 8 // specific to the D3D9 renderer
michael@0 9
michael@0 10 #ifndef LIBGLESV2_RENDERER_RENDERER9_UTILS_H
michael@0 11 #define LIBGLESV2_RENDERER_RENDERER9_UTILS_H
michael@0 12
michael@0 13 #include "libGLESv2/utilities.h"
michael@0 14
michael@0 15 const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z')));
michael@0 16 const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
michael@0 17
michael@0 18 namespace gl_d3d9
michael@0 19 {
michael@0 20
michael@0 21 D3DCMPFUNC ConvertComparison(GLenum comparison);
michael@0 22 D3DCOLOR ConvertColor(gl::Color color);
michael@0 23 D3DBLEND ConvertBlendFunc(GLenum blend);
michael@0 24 D3DBLENDOP ConvertBlendOp(GLenum blendOp);
michael@0 25 D3DSTENCILOP ConvertStencilOp(GLenum stencilOp);
michael@0 26 D3DTEXTUREADDRESS ConvertTextureWrap(GLenum wrap);
michael@0 27 D3DCULL ConvertCullMode(GLenum cullFace, GLenum frontFace);
michael@0 28 D3DCUBEMAP_FACES ConvertCubeFace(GLenum cubeFace);
michael@0 29 DWORD ConvertColorMask(bool red, bool green, bool blue, bool alpha);
michael@0 30 D3DTEXTUREFILTERTYPE ConvertMagFilter(GLenum magFilter, float maxAnisotropy);
michael@0 31 void ConvertMinFilter(GLenum minFilter, D3DTEXTUREFILTERTYPE *d3dMinFilter, D3DTEXTUREFILTERTYPE *d3dMipFilter, float maxAnisotropy);
michael@0 32 D3DFORMAT ConvertRenderbufferFormat(GLenum format);
michael@0 33 D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples);
michael@0 34
michael@0 35 }
michael@0 36
michael@0 37 namespace d3d9_gl
michael@0 38 {
michael@0 39
michael@0 40 GLuint GetAlphaSize(D3DFORMAT colorFormat);
michael@0 41 GLuint GetStencilSize(D3DFORMAT stencilFormat);
michael@0 42
michael@0 43 GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type);
michael@0 44
michael@0 45 bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format);
michael@0 46 GLenum ConvertBackBufferFormat(D3DFORMAT format);
michael@0 47 GLenum ConvertDepthStencilFormat(D3DFORMAT format);
michael@0 48 GLenum ConvertRenderTargetFormat(D3DFORMAT format);
michael@0 49 GLenum GetEquivalentFormat(D3DFORMAT format);
michael@0 50
michael@0 51 }
michael@0 52
michael@0 53 namespace d3d9
michael@0 54 {
michael@0 55 bool IsCompressedFormat(D3DFORMAT format);
michael@0 56 size_t ComputeRowSize(D3DFORMAT format, unsigned int width);
michael@0 57
michael@0 58 inline bool isDeviceLostError(HRESULT errorCode)
michael@0 59 {
michael@0 60 switch (errorCode)
michael@0 61 {
michael@0 62 case D3DERR_DRIVERINTERNALERROR:
michael@0 63 case D3DERR_DEVICELOST:
michael@0 64 case D3DERR_DEVICEHUNG:
michael@0 65 case D3DERR_DEVICEREMOVED:
michael@0 66 return true;
michael@0 67 default:
michael@0 68 return false;
michael@0 69 }
michael@0 70 }
michael@0 71
michael@0 72 }
michael@0 73
michael@0 74 #endif // LIBGLESV2_RENDERER_RENDERER9_UTILS_H

mercurial