LCOV - code coverage report
Current view: top level - source/renderer/backend/dummy - SwapChain.h (source / functions) Hit Total Coverage
Test: 0 A.D. test coverage report Lines: 1 1 100.0 %
Date: 2026-12-03 01:19:39 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* Copyright (C) 2026 Wildfire Games.
       2             :  * This file is part of 0 A.D.
       3             :  *
       4             :  * 0 A.D. is free software: you can redistribute it and/or modify
       5             :  * it under the terms of the GNU General Public License as published by
       6             :  * the Free Software Foundation, either version 2 of the License, or
       7             :  * (at your option) any later version.
       8             :  *
       9             :  * 0 A.D. is distributed in the hope that it will be useful,
      10             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  * GNU General Public License for more details.
      13             :  *
      14             :  * You should have received a copy of the GNU General Public License
      15             :  * along with 0 A.D.  If not, see <http://www.gnu.org/licenses/>.
      16             :  */
      17             : 
      18             : #ifndef INCLUDED_RENDERER_BACKEND_DUMMY_SWAPCHAIN
      19             : #define INCLUDED_RENDERER_BACKEND_DUMMY_SWAPCHAIN
      20             : 
      21             : #include "renderer/backend/ISwapChain.h"
      22             : 
      23             : #include <cstdint>
      24             : #include <memory>
      25             : 
      26             : namespace Renderer
      27             : {
      28             : 
      29             : namespace Backend
      30             : {
      31             : 
      32             : namespace Dummy
      33             : {
      34             : 
      35             : class CDevice;
      36             : 
      37             : class CSwapChain : public ISwapChain
      38             : {
      39             : public:
      40             :     ~CSwapChain() override;
      41             : 
      42             :     IDevice* GetDevice() override;
      43             : 
      44          10 :     bool IsValid() const override { return true; }
      45             : 
      46             :     bool AcquireNextBackbuffer() override;
      47             : 
      48             :     IFramebuffer* GetCurrentBackbuffer(
      49             :         const AttachmentLoadOp colorAttachmentLoadOp,
      50             :         const AttachmentStoreOp colorAttachmentStoreOp,
      51             :         const AttachmentLoadOp depthStencilAttachmentLoadOp,
      52             :         const AttachmentStoreOp depthStencilAttachmentStoreOp) override;
      53             : 
      54             :     void Present() override;
      55             : 
      56             : private:
      57             :     friend class CDevice;
      58             : 
      59             :     static std::unique_ptr<ISwapChain> Create(CDevice* device);
      60             : 
      61             :     CSwapChain();
      62             : 
      63             :     CDevice* m_Device{nullptr};
      64             : 
      65             :     std::unique_ptr<IFramebuffer> m_Backbuffer;
      66             : };
      67             : 
      68             : } // namespace Dummy
      69             : 
      70             : } // namespace Backend
      71             : 
      72             : } // namespace Renderer
      73             : 
      74             : #endif // INCLUDED_RENDERER_BACKEND_DUMMY_SWAPCHAIN

Generated by: LCOV version 1.16