mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:47:34 +00:00
AK: Add Retained<T>, like RetainPtr, but never null.
Also use some Clang attribute wizardry to get a warning for use-after-move.
This commit is contained in:
parent
0b957ed2b1
commit
2cfcbdc735
31 changed files with 214 additions and 104 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue