Repository: xbmc/xbmc
File: xbmc/windowing/WinSystem.h (C/C++)

Code before:

  /*!
   * @brief Queries the age of the current backbuffer.
   *
   * @return Returns the buffer age. Usual values are: 1 for double buffering,
   * 2 for triple buffering.
   *
   * @note Should be called once before any draw call, as it triggers damaged
   * regions rendering.
   */
  virtual int32_t GetBufferAge() { return 2; }
  /*!
   * @brief Queries the GPU driver if it supports damaged regions.
   *
   * @return Returns true if the driver supports damaged regions.
   *
   * @note Especially tilers should support it. See EGL_KHR_partial_update for
   * more info.
   */
  virtual bool HasDamagedRegionSupport() { return false; }
  /*!
   * @brief Sets the damaged regions.
   *
   * @param damagedRegions The list which regions need to be redrawn.
   */
  virtual void SetDamagedRegions(const CDirtyRegionList& damagedRegions){};

protected:
  void UpdateDesktopResolution(RESOLUTION_INFO& newRes, const std::string &output, int width, int height, float refreshRate, uint32_t dwFlags);
  virtual std::unique_ptr<KODI::WINDOWING::IOSScreenSaver> GetOSScreenSaverImpl() { return nullptr; }

  int m_nWidth = 0;
  int m_nHeight = 0;
  int m_nTop = 0;
  int m_nLeft = 0;
  bool m_bWindowCreated = false;
  bool m_bFullScreen = false;
  bool m_bBlankOtherDisplay = false;
  float m_fRefreshRate = 0.0f;
  std::unique_ptr<KODI::WINDOWING::COSScreenSaverManager> m_screenSaverManager;
  CCriticalSection m_renderLoopSection;
  std::vector<IRenderLoop*> m_renderLoopClients;

  std::unique_ptr<IWinEvents> m_winEvents;
  std::unique_ptr<CGraphicContext> m_gfxContext;
  std::shared_ptr<CDPMSSupport> m_dpms;
};


Review comment (suggestion):
```suggestion
  virtual void SetDamagedRegions(const CDirtyRegionList& damagedRegions) {}
```

Code after:
  // Display event callback
  virtual void Register(IDispResource *resource) = 0;
  virtual void Unregister(IDispResource *resource) = 0;

  // render loop
  void RegisterRenderLoop(IRenderLoop *client);
  void UnregisterRenderLoop(IRenderLoop *client);
  void DriveRenderLoop();

  // winsystem events
  virtual bool MessagePump() { return false; }

  // Access render system interface
  virtual CGraphicContext& GetGfxContext() const;

  /*!
   * \brief Get OS specific hardware context
   *
   * \return OS specific context or nullptr if OS not have
   *
   * \note This function is currently only related to Windows with DirectX,
   * all other OS where use GL returns nullptr.
   * Returned Windows class pointer is ID3D11DeviceContext1.
   */
  virtual void* GetHWContext() { return nullptr; }

  std::shared_ptr<CDPMSSupport> GetDPMSManager();

  /*!
   * \brief Set the HDR metadata. Passing nullptr as the parameter should
   * disable HDR.
   *
   */
  virtual bool SetHDR(const VideoPicture* videoPicture) { return false; }
  virtual bool IsHDRDisplay() { return false; }
  virtual HDR_STATUS ToggleHDR() { return HDR_STATUS::HDR_UNSUPPORTED; }
  virtual HDR_STATUS GetOSHDRStatus() { return HDR_STATUS::HDR_UNSUPPORTED; }
  virtual CHDRCapabilities GetDisplayHDRCapabilities() const { return {}; }
  static const char* SETTING_WINSYSTEM_IS_HDR_DISPLAY;
  virtual float GetGuiSdrPeakLuminance() const { return .0f; }
  virtual bool HasSystemSdrPeakLuminance() { return false; }

  /*!
   * \brief System supports Video Super Resolution HW upscaler i.e.:
   * "NVIDIA RTX Video Super Resolution" or "Intel Video Super Resolution"
   *
   */
  virtual bool SupportsVideoSuperResolution() { return false; }

  /*!
   * \brief Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)