Repository: xbmc/xbmc
File: xbmc/rendering/dx/RenderSystemDX.h (C/C++)

Code before:
  void OnDXDeviceRestored() override;

  // CRenderSystemDX methods
  CGUIShaderDX* GetGUIShader() const { return m_pGUIShader; }
  bool IsFormatSupport(DXGI_FORMAT format, unsigned int usage) const;
  CRect GetBackBufferRect();
  CD3DTexture& GetBackBuffer();

  void FlushGPU() const;
  void RequestDecodingTime();
  void ReleaseDecodingTime();
  void SetAlphaBlendEnable(bool enable);

  // empty overrides
  bool IsExtSupported(const char* extension) const override { return false; }
  bool ResetRenderSystem(int width, int height) override { return true; }

protected:
  virtual void PresentRenderImpl(bool rendered) = 0;

  bool CreateStates();
  bool InitGUIShader();
  void OnResize();
  void CheckInterlacedStereoView(void);
  void CheckDeviceCaps();
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> GetDepthStencilState();

  CCriticalSection m_resourceSection;
  CCriticalSection m_decoderSection;

  // our adapter could change as we go
  bool m_inScene{ false }; ///< True if we're in a BeginScene()/EndScene() block
  bool m_BlendEnabled{ false };
  bool m_ScissorsEnabled{ false };
  D3D11_VIEWPORT m_viewPort;
  CRect m_scissor;
  CGUIShaderDX* m_pGUIShader{ nullptr };
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthStencilState;
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthStencilStateRO;
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthStencilStateRW;

  Microsoft::WRL::ComPtr<ID3D11BlendState> m_BlendEnableState;
  Microsoft::WRL::ComPtr<ID3D11BlendState> m_BlendDisableState;
  Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_RSScissorDisable;
  Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_RSScissorEnable;
  // stereo interlaced/checkerboard intermediate target
  CD3DTexture m_rightEyeTex;

  XbmcThreads::EndTime<> m_decodingTimer;
  XbmcThreads::ConditionVariable m_decodingEvent;


Review comment (suggestion):
This not seems quite common. Maybe is enough return underlaying `ID3D11DepthStencilState` interface.
```suggestion
ID3D11DepthStencilState* GetDepthStencilState() const;
```

Code after:
  void OnDXDeviceRestored() override;

  // CRenderSystemDX methods
  CGUIShaderDX* GetGUIShader() const { return m_pGUIShader; }
  bool IsFormatSupport(DXGI_FORMAT format, unsigned int usage) const;
  CRect GetBackBufferRect();
  CD3DTexture& GetBackBuffer();

  void FlushGPU() const;
  void RequestDecodingTime();
  void ReleaseDecodingTime();
  void SetAlphaBlendEnable(bool enable);

  // empty overrides
  bool IsExtSupported(const char* extension) const override { return false; }
  bool ResetRenderSystem(int width, int height) override { return true; }

protected:
  virtual void PresentRenderImpl(bool rendered) = 0;

  bool CreateStates();
  bool InitGUIShader();
  void OnResize();
  void CheckInterlacedStereoView(void);
  void CheckDeviceCaps();
  ID3D11DepthStencilState* GetDepthStencilState();

  CCriticalSection m_resourceSection;
  CCriticalSection m_decoderSection;

  // our adapter could change as we go
  bool m_inScene{ false }; ///< True if we're in a BeginScene()/EndScene() block
  bool m_BlendEnabled{ false };
  bool m_ScissorsEnabled{ false };
  D3D11_VIEWPORT m_viewPort;
  CRect m_scissor;
  CGUIShaderDX* m_pGUIShader{ nullptr };
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthStencilState;
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthStencilStateRO;
  Microsoft::WRL::ComPtr<ID3D11DepthStencilState> m_depthStencilStateRW;

  Microsoft::WRL::ComPtr<ID3D11BlendState> m_BlendEnableState;
  Microsoft::WRL::ComPtr<ID3D11BlendState> m_BlendDisableState;
  Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_RSScissorDisable;
  Microsoft::WRL::ComPtr<ID3D11RasterizerState> m_RSScissorEnable;
  // stereo interlaced/checkerboard intermediate target
  CD3DTexture m_rightEyeTex;

  XbmcThreads::EndTime<> m_decodingTimer;
  XbmcThreads::ConditionVariable m_decodingEvent;