summaryrefslogtreecommitdiff
path: root/SharedGraphics
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-25 12:43:52 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-25 12:43:52 +0100
commit2cfcbdc735e7578a22ed2f9ae25492a72abe3f3f (patch)
treeffbb4403f13fe7d105951e965180638907f3662d /SharedGraphics
parent0b957ed2b1cd6b4949c93c5b39b64b0caf060c12 (diff)
downloadserenity-2cfcbdc735e7578a22ed2f9ae25492a72abe3f3f.zip
AK: Add Retained<T>, like RetainPtr, but never null.
Also use some Clang attribute wizardry to get a warning for use-after-move.
Diffstat (limited to 'SharedGraphics')
-rw-r--r--SharedGraphics/GraphicsBitmap.cpp4
-rw-r--r--SharedGraphics/GraphicsBitmap.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/SharedGraphics/GraphicsBitmap.cpp b/SharedGraphics/GraphicsBitmap.cpp
index 40f25ee697..035f17e9a4 100644
--- a/SharedGraphics/GraphicsBitmap.cpp
+++ b/SharedGraphics/GraphicsBitmap.cpp
@@ -5,7 +5,7 @@
#include <errno.h>
#include <stdio.h>
-RetainPtr<GraphicsBitmap> GraphicsBitmap::create(Format format, const Size& size)
+Retained<GraphicsBitmap> GraphicsBitmap::create(Format format, const Size& size)
{
return adopt(*new GraphicsBitmap(format, size));
}
@@ -22,7 +22,7 @@ GraphicsBitmap::GraphicsBitmap(Format format, const Size& size)
m_mmaped = true;
}
-RetainPtr<GraphicsBitmap> GraphicsBitmap::create_wrapper(Format format, const Size& size, RGBA32* data)
+Retained<GraphicsBitmap> GraphicsBitmap::create_wrapper(Format format, const Size& size, RGBA32* data)
{
return adopt(*new GraphicsBitmap(format, size, data));
}
diff --git a/SharedGraphics/GraphicsBitmap.h b/SharedGraphics/GraphicsBitmap.h
index 7d8f2ec65f..792e0d0076 100644
--- a/SharedGraphics/GraphicsBitmap.h
+++ b/SharedGraphics/GraphicsBitmap.h
@@ -11,8 +11,8 @@ class GraphicsBitmap : public Retainable<GraphicsBitmap> {
public:
enum class Format { Invalid, RGB32, RGBA32 };
- static RetainPtr<GraphicsBitmap> create(Format, const Size&);
- static RetainPtr<GraphicsBitmap> create_wrapper(Format, const Size&, RGBA32*);
+ static Retained<GraphicsBitmap> create(Format, const Size&);
+ static Retained<GraphicsBitmap> create_wrapper(Format, const Size&, RGBA32*);
static RetainPtr<GraphicsBitmap> load_from_file(Format, const String& path, const Size&);
static RetainPtr<GraphicsBitmap> create_with_shared_buffer(Format, int shared_buffer_id, const Size&, RGBA32* buffer = nullptr);
~GraphicsBitmap();