1 /* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/RefPtr.h"
10 #include "GLContext.h"
11 #include "skia/GrGLInterface.h"
12 #include "skia/GrContext.h"
13 #include "mozilla/gfx/HelpersSkia.h"
18 class SkiaGLGlue
: public GenericAtomicRefCounted
21 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SkiaGLGlue
)
22 explicit SkiaGLGlue(GLContext
* context
);
23 GLContext
* GetGLContext() const { return mGLContext
.get(); }
24 GrContext
* GetGrContext() const { return mGrContext
.get(); }
27 virtual ~SkiaGLGlue() {
29 * These members have inter-dependencies, but do not keep each other alive, so
30 * destruction order is very important here: mGrContext uses mGrGLInterface, and
31 * through it, uses mGLContext
34 mGrGLInterface
= nullptr;
39 RefPtr
<GLContext
> mGLContext
;
40 mozilla::gfx::RefPtrSkia
<GrGLInterface
> mGrGLInterface
;
41 mozilla::gfx::RefPtrSkia
<GrContext
> mGrContext
;
56 class SkiaGLGlue
: public GenericAtomicRefCounted
59 SkiaGLGlue(GLContext
* context
);
60 GLContext
* GetGLContext() const { return nullptr; }
61 GrContext
* GetGrContext() const { return nullptr; }