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.

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

mercurial