Bumping manifests a=b2g-bump
[gecko.git] / gfx / gl / SkiaGLGlue.h
blob82b125c867d60c9083d24a05032c4ec15c0d2169
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"
8 #ifdef USE_SKIA_GPU
10 #include "GLContext.h"
11 #include "skia/GrGLInterface.h"
12 #include "skia/GrContext.h"
13 #include "mozilla/gfx/HelpersSkia.h"
15 namespace mozilla {
16 namespace gl {
18 class SkiaGLGlue : public GenericAtomicRefCounted
20 public:
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(); }
26 protected:
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
33 mGrContext = nullptr;
34 mGrGLInterface = nullptr;
35 mGLContext = nullptr;
38 private:
39 RefPtr<GLContext> mGLContext;
40 mozilla::gfx::RefPtrSkia<GrGLInterface> mGrGLInterface;
41 mozilla::gfx::RefPtrSkia<GrContext> mGrContext;
47 #else
49 class GrContext;
51 namespace mozilla {
52 namespace gl {
54 class GLContext;
56 class SkiaGLGlue : public GenericAtomicRefCounted
58 public:
59 SkiaGLGlue(GLContext* context);
60 GLContext* GetGLContext() const { return nullptr; }
61 GrContext* GetGrContext() const { return nullptr; }
66 #endif