core: refactor renderable size ownership (#4512)
This commit is contained in:
@@ -34,6 +34,7 @@ protected:
|
||||
virtual ~Renderable() = default;
|
||||
|
||||
public:
|
||||
/// Returns the renderable dimensions in physical pixels.
|
||||
Size getSize() const { return size; }
|
||||
|
||||
template <typename T>
|
||||
@@ -50,8 +51,12 @@ public:
|
||||
|
||||
bool operator!=(const Renderable& other) const { return resource.get() != other.resource.get(); }
|
||||
|
||||
protected:
|
||||
private:
|
||||
Size size;
|
||||
|
||||
protected:
|
||||
void setRenderableSize(const Size& size_) noexcept { size = size_; }
|
||||
|
||||
std::unique_ptr<RenderableResource> resource;
|
||||
};
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ protected:
|
||||
~Renderable() override = default;
|
||||
|
||||
public:
|
||||
void setSize(const Size& size_) { size = size_; }
|
||||
void setSize(const Size& size_) { setRenderableSize(size_); }
|
||||
};
|
||||
|
||||
} // namespace vulkan
|
||||
|
||||
Reference in New Issue
Block a user