mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
LibAccelGfx+LibWeb: Use framebuffer object instead of EGLs PBuffer
Framebuffer object is allocated using OpenGL's API and is not platform specific which means it could be used on both macOS and Linux unlike EGL specific PBuffer.
This commit is contained in:
parent
99caf4e649
commit
6d1a1daff9
12 changed files with 70 additions and 132 deletions
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibAccelGfx/Context.h>
|
||||
#include <LibAccelGfx/Forward.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
||||
namespace AccelGfx {
|
||||
|
||||
class Canvas {
|
||||
public:
|
||||
static Canvas create(Context& context, NonnullRefPtr<Gfx::Bitmap> bitmap);
|
||||
|
||||
[[nodiscard]] Gfx::IntSize size() const { return m_bitmap->size(); }
|
||||
[[nodiscard]] int width() const { return m_bitmap->width(); }
|
||||
[[nodiscard]] int height() const { return m_bitmap->height(); }
|
||||
|
||||
void flush();
|
||||
|
||||
[[nodiscard]] Gfx::Bitmap const& bitmap() const { return *m_bitmap; }
|
||||
|
||||
~Canvas();
|
||||
|
||||
private:
|
||||
explicit Canvas(NonnullRefPtr<Gfx::Bitmap>, Context&);
|
||||
|
||||
void initialize();
|
||||
|
||||
NonnullRefPtr<Gfx::Bitmap> m_bitmap;
|
||||
|
||||
Context& m_context;
|
||||
Context::Surface m_surface;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue