tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

SwapChainD3D.cpp (881B)


      1 //
      2 // Copyright 2016 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 //
      6 
      7 // SwapChainD3D.cpp: Defines a back-end specific class that hides the details of the
      8 // implementation-specific swapchain.
      9 
     10 #include "libANGLE/renderer/d3d/SwapChainD3D.h"
     11 
     12 namespace rx
     13 {
     14 
     15 SwapChainD3D::SwapChainD3D(HANDLE shareHandle,
     16                           IUnknown *d3dTexture,
     17                           GLenum backBufferFormat,
     18                           GLenum depthBufferFormat)
     19    : mOffscreenRenderTargetFormat(backBufferFormat),
     20      mDepthBufferFormat(depthBufferFormat),
     21      mShareHandle(shareHandle),
     22      mD3DTexture(d3dTexture)
     23 {
     24    if (mD3DTexture)
     25    {
     26        mD3DTexture->AddRef();
     27    }
     28 }
     29 
     30 SwapChainD3D::~SwapChainD3D()
     31 {
     32    SafeRelease(mD3DTexture);
     33 }
     34 }  // namespace rx