mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 11:47:34 +00:00
LibAccelGfx+LibWeb: Explicitly pass OpenGL context to Painter
Let's not assume there is one global OpenGL context because it might change once we will start creating >1 page inside single WebContent process or contexts for WebGL.
This commit is contained in:
parent
ed1ade0534
commit
161082e282
8 changed files with 25 additions and 20 deletions
|
@ -16,14 +16,6 @@
|
|||
|
||||
namespace AccelGfx {
|
||||
|
||||
Context& Context::the()
|
||||
{
|
||||
static OwnPtr<Context> s_the;
|
||||
if (!s_the)
|
||||
s_the = Context::create();
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
static void make_context_cgl()
|
||||
{
|
||||
|
|
|
@ -20,8 +20,6 @@ namespace AccelGfx {
|
|||
|
||||
class Context {
|
||||
public:
|
||||
static Context& the();
|
||||
|
||||
static OwnPtr<Context> create();
|
||||
|
||||
Context()
|
||||
|
|
|
@ -170,9 +170,8 @@ void main() {
|
|||
|
||||
HashMap<u32, GL::Texture> s_immutable_bitmap_texture_cache;
|
||||
|
||||
NonnullOwnPtr<Painter> Painter::create()
|
||||
NonnullOwnPtr<Painter> Painter::create(Context& context)
|
||||
{
|
||||
auto& context = Context::the();
|
||||
return make<Painter>(context);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class Painter {
|
|||
AK_MAKE_NONMOVABLE(Painter);
|
||||
|
||||
public:
|
||||
static NonnullOwnPtr<Painter> create();
|
||||
static NonnullOwnPtr<Painter> create(Context&);
|
||||
|
||||
Painter(Context&);
|
||||
~Painter();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue