Skip to content

Commit

Permalink
Merge pull request #8267 from lioncash/null
Browse files Browse the repository at this point in the history
VideoBackends/Null: Minor cleanup
  • Loading branch information
Helios747 committed Jul 27, 2019
2 parents f04a01e + 6db305a commit a9e04e0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 38 deletions.
7 changes: 7 additions & 0 deletions Source/Core/VideoBackends/Null/NullBackend.cpp
Expand Up @@ -13,6 +13,7 @@
#include "VideoBackends/Null/VertexManager.h" #include "VideoBackends/Null/VertexManager.h"
#include "VideoBackends/Null/VideoBackend.h" #include "VideoBackends/Null/VideoBackend.h"


#include "Common/Common.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"


#include "VideoCommon/FramebufferManager.h" #include "VideoCommon/FramebufferManager.h"
Expand Down Expand Up @@ -97,4 +98,10 @@ void VideoBackend::Shutdown()


ShutdownShared(); ShutdownShared();
} }

std::string VideoBackend::GetDisplayName() const
{
// i18n: Null is referring to the null video backend, which renders nothing
return _trans("Null");
}
} // namespace Null } // namespace Null
2 changes: 0 additions & 2 deletions Source/Core/VideoBackends/Null/NullTexture.h
Expand Up @@ -19,7 +19,6 @@ class NullTexture final : public AbstractTexture
{ {
public: public:
explicit NullTexture(const TextureConfig& config); explicit NullTexture(const TextureConfig& config);
~NullTexture() = default;


void CopyRectangleFromTexture(const AbstractTexture* src, void CopyRectangleFromTexture(const AbstractTexture* src,
const MathUtil::Rectangle<int>& src_rect, u32 src_layer, const MathUtil::Rectangle<int>& src_rect, u32 src_layer,
Expand Down Expand Up @@ -58,7 +57,6 @@ class NullFramebuffer final : public AbstractFramebuffer
explicit NullFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment, explicit NullFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment,
AbstractTextureFormat color_format, AbstractTextureFormat depth_format, AbstractTextureFormat color_format, AbstractTextureFormat depth_format,
u32 width, u32 height, u32 layers, u32 samples); u32 width, u32 height, u32 layers, u32 samples);
~NullFramebuffer() override = default;


static std::unique_ptr<NullFramebuffer> Create(NullTexture* color_attachment, static std::unique_ptr<NullFramebuffer> Create(NullTexture* color_attachment,
NullTexture* depth_attachment); NullTexture* depth_attachment);
Expand Down
4 changes: 1 addition & 3 deletions Source/Core/VideoBackends/Null/PerfQuery.h
Expand Up @@ -8,11 +8,9 @@


namespace Null namespace Null
{ {
class PerfQuery : public PerfQueryBase class PerfQuery final : public PerfQueryBase
{ {
public: public:
PerfQuery() {}
~PerfQuery() override {}
void EnableQuery(PerfQueryGroup type) override {} void EnableQuery(PerfQueryGroup type) override {}
void DisableQuery(PerfQueryGroup type) override {} void DisableQuery(PerfQueryGroup type) override {}
void ResetQuery() override {} void ResetQuery() override {}
Expand Down
7 changes: 1 addition & 6 deletions Source/Core/VideoBackends/Null/Render.cpp
Expand Up @@ -2,10 +2,9 @@
// Licensed under GPLv2+ // Licensed under GPLv2+
// Refer to the license.txt file included. // Refer to the license.txt file included.


#include "Common/Logging/Log.h" #include "VideoBackends/Null/Render.h"


#include "VideoBackends/Null/NullTexture.h" #include "VideoBackends/Null/NullTexture.h"
#include "VideoBackends/Null/Render.h"


#include "VideoCommon/AbstractPipeline.h" #include "VideoCommon/AbstractPipeline.h"
#include "VideoCommon/AbstractShader.h" #include "VideoCommon/AbstractShader.h"
Expand Down Expand Up @@ -45,7 +44,6 @@ class NullShader final : public AbstractShader
{ {
public: public:
explicit NullShader(ShaderStage stage) : AbstractShader(stage) {} explicit NullShader(ShaderStage stage) : AbstractShader(stage) {}
~NullShader() = default;
}; };


std::unique_ptr<AbstractShader> std::unique_ptr<AbstractShader>
Expand All @@ -62,9 +60,6 @@ std::unique_ptr<AbstractShader> Renderer::CreateShaderFromBinary(ShaderStage sta


class NullPipeline final : public AbstractPipeline class NullPipeline final : public AbstractPipeline
{ {
public:
NullPipeline() = default;
~NullPipeline() override = default;
}; };


std::unique_ptr<AbstractPipeline> Renderer::CreatePipeline(const AbstractPipelineConfig& config, std::unique_ptr<AbstractPipeline> Renderer::CreatePipeline(const AbstractPipelineConfig& config,
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/Null/Render.h
Expand Up @@ -8,7 +8,7 @@


namespace Null namespace Null
{ {
class Renderer : public ::Renderer class Renderer final : public ::Renderer
{ {
public: public:
Renderer(); Renderer();
Expand Down
11 changes: 1 addition & 10 deletions Source/Core/VideoBackends/Null/TextureCache.h
Expand Up @@ -4,21 +4,12 @@


#pragma once #pragma once


#include <memory>

#include "VideoBackends/Null/NullTexture.h"

#include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/TextureCacheBase.h"
#include "VideoCommon/TextureConfig.h"


namespace Null namespace Null
{ {
class TextureCache : public TextureCacheBase class TextureCache final : public TextureCacheBase
{ {
public:
TextureCache() {}
~TextureCache() {}

protected: protected:
void CopyEFB(AbstractStagingTexture* dst, const EFBCopyParams& params, u32 native_width, void CopyEFB(AbstractStagingTexture* dst, const EFBCopyParams& params, u32 native_width,
u32 bytes_per_row, u32 num_blocks_y, u32 memory_stride, u32 bytes_per_row, u32 num_blocks_y, u32 memory_stride,
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/VideoBackends/Null/VertexManager.cpp
Expand Up @@ -3,10 +3,6 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.


#include "VideoBackends/Null/VertexManager.h" #include "VideoBackends/Null/VertexManager.h"
#include "VideoBackends/Null/Render.h"

#include "VideoCommon/IndexGenerator.h"
#include "VideoCommon/VertexLoaderManager.h"


namespace Null namespace Null
{ {
Expand Down
7 changes: 2 additions & 5 deletions Source/Core/VideoBackends/Null/VertexManager.h
Expand Up @@ -4,18 +4,15 @@


#pragma once #pragma once


#include <memory>
#include <vector>

#include "VideoCommon/VertexManagerBase.h" #include "VideoCommon/VertexManagerBase.h"


namespace Null namespace Null
{ {
class VertexManager : public VertexManagerBase class VertexManager final : public VertexManagerBase
{ {
public: public:
VertexManager(); VertexManager();
~VertexManager(); ~VertexManager() override;


protected: protected:
void DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_vertex) override; void DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_vertex) override;
Expand Down
9 changes: 2 additions & 7 deletions Source/Core/VideoBackends/Null/VideoBackend.h
Expand Up @@ -4,22 +4,17 @@


#pragma once #pragma once


#include "Common/Common.h"
#include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoBackendBase.h"


namespace Null namespace Null
{ {
class VideoBackend : public VideoBackendBase class VideoBackend final : public VideoBackendBase
{ {
bool Initialize(const WindowSystemInfo& wsi) override; bool Initialize(const WindowSystemInfo& wsi) override;
void Shutdown() override; void Shutdown() override;


std::string GetName() const override { return "Null"; } std::string GetName() const override { return "Null"; }
std::string GetDisplayName() const override std::string GetDisplayName() const override;
{
// i18n: Null is referring to the null video backend, which renders nothing
return _trans("Null");
}
void InitBackendInfo() override; void InitBackendInfo() override;
}; };
} // namespace Null } // namespace Null

0 comments on commit a9e04e0

Please sign in to comment.