2014-03-05 13:49:37 -08:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2015-08-07 19:27:14 -07:00
|
|
|
#ifndef SKIA_GL_GLUE_H_
|
|
|
|
#define SKIA_GL_GLUE_H_
|
2014-03-05 13:49:37 -08:00
|
|
|
|
|
|
|
#ifdef USE_SKIA_GPU
|
|
|
|
|
2015-08-07 19:27:14 -07:00
|
|
|
#include "mozilla/gfx/RefPtrSkia.h"
|
2015-10-17 22:24:48 -07:00
|
|
|
#include "mozilla/RefPtr.h"
|
2015-08-07 19:27:14 -07:00
|
|
|
|
|
|
|
struct GrGLInterface;
|
|
|
|
class GrContext;
|
2014-03-05 13:49:37 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
2015-08-07 19:27:14 -07:00
|
|
|
class GLContext;
|
|
|
|
|
2014-03-05 13:49:37 -08:00
|
|
|
class SkiaGLGlue : public GenericAtomicRefCounted
|
|
|
|
{
|
|
|
|
public:
|
2014-03-09 11:40:49 -07:00
|
|
|
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SkiaGLGlue)
|
2014-08-31 20:31:20 -07:00
|
|
|
explicit SkiaGLGlue(GLContext* context);
|
2014-03-05 13:49:37 -08:00
|
|
|
GLContext* GetGLContext() const { return mGLContext.get(); }
|
|
|
|
GrContext* GetGrContext() const { return mGrContext.get(); }
|
|
|
|
|
|
|
|
protected:
|
2015-08-07 19:27:14 -07:00
|
|
|
virtual ~SkiaGLGlue();
|
2014-03-05 13:49:37 -08:00
|
|
|
|
|
|
|
private:
|
2015-10-17 22:24:48 -07:00
|
|
|
RefPtr<GLContext> mGLContext;
|
2015-08-07 19:27:14 -07:00
|
|
|
gfx::RefPtrSkia<GrGLInterface> mGrGLInterface;
|
|
|
|
gfx::RefPtrSkia<GrContext> mGrContext;
|
2014-03-05 13:49:37 -08:00
|
|
|
};
|
|
|
|
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace gl
|
|
|
|
} // namespace mozilla
|
2014-03-05 13:49:37 -08:00
|
|
|
|
2015-08-07 19:27:14 -07:00
|
|
|
#else // USE_SKIA_GPU
|
2014-03-05 13:49:37 -08:00
|
|
|
|
|
|
|
class GrContext;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
|
|
|
class GLContext;
|
|
|
|
|
|
|
|
class SkiaGLGlue : public GenericAtomicRefCounted
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SkiaGLGlue(GLContext* context);
|
|
|
|
GLContext* GetGLContext() const { return nullptr; }
|
|
|
|
GrContext* GetGrContext() const { return nullptr; }
|
|
|
|
};
|
|
|
|
|
2015-08-07 19:27:14 -07:00
|
|
|
} // namespace gl
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // USE_SKIA_GPU
|
|
|
|
|
|
|
|
#endif // SKIA_GL_GLUE_H_
|