[drape] Fixed signed/unsigned comparison warning by changing Resize interface to uint32_t

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-08-01 13:01:16 +02:00
committed by Konstantin Pastbin
parent 55dc1e17e6
commit a28d5d15ce
11 changed files with 27 additions and 29 deletions

View File

@@ -61,7 +61,7 @@ public:
virtual void ForgetFramebuffer(ref_ptr<BaseFramebuffer> framebuffer) = 0;
virtual void ApplyFramebuffer(std::string const & framebufferLabel) = 0;
// w, h - pixel size of render target (logical size * visual scale).
virtual void Resize(int /* w */, int /* h */) {}
virtual void Resize(uint32_t /* w */, uint32_t /* h */) {}
virtual void SetRenderingEnabled(bool /* enabled */) {}
virtual void SetPresentAvailable(bool /* available */) {}
virtual bool Validate() { return true; }

View File

@@ -31,7 +31,7 @@ public:
void MakeCurrent() override {}
void DoneCurrent() override {}
bool Validate() override { return true; }
void Resize(int w, int h) override;
void Resize(uint32_t w, uint32_t h) override;
void SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override;
void ForgetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override {}
void ApplyFramebuffer(std::string const & framebufferLabel) override;

View File

@@ -130,12 +130,12 @@ void MetalBaseContext::PopDebugLabel()
[m_currentCommandEncoder popDebugGroup];
}
void MetalBaseContext::Resize(int w, int h)
void MetalBaseContext::Resize(uint32_t w, uint32_t h)
{
if (m_depthTexture && m_depthTexture->GetWidth() == w && m_depthTexture->GetHeight() == h)
return;
RecreateDepthTexture(m2::PointU(w, h));
RecreateDepthTexture({w, h});
}
void MetalBaseContext::SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer)

View File

@@ -142,15 +142,15 @@ void VulkanBaseContext::SetRenderingQueue(VkQueue queue)
m_queue = queue;
}
void VulkanBaseContext::Resize(int w, int h)
void VulkanBaseContext::Resize(uint32_t w, uint32_t h)
{
if (m_swapchain != VK_NULL_HANDLE && m_surfaceCapabilities.currentExtent.width == static_cast<uint32_t>(w) &&
m_surfaceCapabilities.currentExtent.height == static_cast<uint32_t>(h))
if (m_swapchain != VK_NULL_HANDLE && m_surfaceCapabilities.currentExtent.width == w &&
m_surfaceCapabilities.currentExtent.height == h)
{
return;
}
m_surfaceCapabilities.currentExtent.width = static_cast<uint32_t>(w);
m_surfaceCapabilities.currentExtent.height = static_cast<uint32_t>(h);
m_surfaceCapabilities.currentExtent.width = w;
m_surfaceCapabilities.currentExtent.height = h;
RecreateSwapchainAndDependencies();
}

View File

@@ -40,7 +40,7 @@ public:
void CollectMemory() override;
void DoneCurrent() override {}
bool Validate() override { return true; }
void Resize(int w, int h) override;
void Resize(uint32_t w, uint32_t h) override;
void SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override;
void ForgetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override;
void ApplyFramebuffer(std::string const & framebufferLabel) override;

View File

@@ -50,7 +50,7 @@ public:
void Present() override {}
void Resize(int w, int h) override {}
void Resize(uint32_t w, uint32_t h) override {}
void SetFramebuffer(ref_ptr<dp::BaseFramebuffer> framebuffer) override {}
void Init(dp::ApiVersion apiVersion) override { CHECK_EQUAL(apiVersion, dp::ApiVersion::Vulkan, ()); }