gfx/layers/d3d9/Nv3DVUtils.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 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef GFX_NV3DVUTILS_H
     7 #define GFX_NV3DVUTILS_H
     9 #include "Layers.h"
    10 #include <windows.h>
    11 #include <d3d9.h>
    13 namespace mozilla {
    14 namespace layers {
    16 #define FIREFOX_3DV_APP_HANDLE    0xECB992B6
    18 enum Nv_Stereo_Mode {
    19   NV_STEREO_MODE_LEFT_RIGHT = 0,
    20   NV_STEREO_MODE_RIGHT_LEFT = 1,
    21   NV_STEREO_MODE_TOP_BOTTOM = 2,
    22   NV_STEREO_MODE_BOTTOM_TOP = 3,
    23   NV_STEREO_MODE_MONO       = 4,
    24   NV_STEREO_MODE_LAST       = 5
    25 };
    27 class INv3DVStreaming : public IUnknown {
    29 public:
    30   virtual bool Nv3DVInitialize()                  = 0;
    31   virtual bool Nv3DVRelease()                     = 0;
    32   virtual bool Nv3DVSetDevice(IUnknown* pDevice)  = 0;
    33   virtual bool Nv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle) = 0;
    34   virtual bool Nv3DVMetaData(DWORD dwWidth, DWORD dwHeight, HANDLE hSrcLuma, HANDLE hDst) = 0;
    35 };
    37 /*
    38  * Nv3DVUtils class
    39  */
    40 class Nv3DVUtils {
    42 public:
    43   Nv3DVUtils();
    44   ~Nv3DVUtils();
    46   /*
    47    * Initializes the Nv3DVUtils object.
    48    */
    49   void Initialize();
    51   /*
    52    * Release any resources if needed
    53    *
    54    */
    55   void UnInitialize();
    57   /*
    58    * Sets the device info, along with any other initialization that is needed after device creation
    59    * Pass the D3D9 device pointer is an IUnknown input argument
    60    */
    61   void SetDeviceInfo(IUnknown *devUnknown);
    63   /*
    64    * Send Stereo Control Information. Used mainly to re-route 
    65    * calls from ImageLayerD3D9 to the 3DV COM object
    66    */
    67   void SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle);
    69   /*
    70    * Send Stereo Metadata. Used mainly to re-route calls 
    71    * from ImageLayerD3D9 to the 3DV COM object
    72    */
    73   void SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst);
    75 private:
    77   /* Nv3DVStreaming interface pointer */
    78   nsRefPtr<INv3DVStreaming> m3DVStreaming;
    80 };
    83 } /* layers */
    84 } /* mozilla */
    86 #endif /* GFX_NV3DVUTILS_H */

mercurial