2014-03-05 21:49:37 +00: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-08 02:27:14 +00:00
|
|
|
#ifndef SKIA_GL_GLUE_H_
|
|
|
|
#define SKIA_GL_GLUE_H_
|
2014-03-05 21:49:37 +00:00
|
|
|
|
|
|
|
#ifdef USE_SKIA_GPU
|
|
|
|
|
2015-08-08 02:27:14 +00:00
|
|
|
#include "mozilla/gfx/RefPtrSkia.h"
|
2015-10-18 05:24:48 +00:00
|
|
|
#include "mozilla/RefPtr.h"
|
2015-08-08 02:27:14 +00:00
|
|
|
|
|
|
|
struct GrGLInterface;
|
|
|
|
class GrContext;
|
2014-03-05 21:49:37 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
2015-08-08 02:27:14 +00:00
|
|
|
class GLContext;
|
|
|
|
|
2014-03-05 21:49:37 +00:00
|
|
|
class SkiaGLGlue : public GenericAtomicRefCounted
|
|
|
|
{
|
|
|
|
public:
|
2014-03-09 18:40:49 +00:00
|
|
|
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SkiaGLGlue)
|
2014-09-01 03:31:20 +00:00
|
|
|
explicit SkiaGLGlue(GLContext* context);
|
2014-03-05 21:49:37 +00:00
|
|
|
GLContext* GetGLContext() const { return mGLContext.get(); }
|
|
|
|
GrContext* GetGrContext() const { return mGrContext.get(); }
|
|
|
|
|
|
|
|
protected:
|
2015-08-08 02:27:14 +00:00
|
|
|
virtual ~SkiaGLGlue();
|
2014-03-05 21:49:37 +00:00
|
|
|
|
|
|
|
private:
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<GLContext> mGLContext;
|
2015-08-08 02:27:14 +00:00
|
|
|
gfx::RefPtrSkia<GrGLInterface> mGrGLInterface;
|
|
|
|
gfx::RefPtrSkia<GrContext> mGrContext;
|
2014-03-05 21:49:37 +00:00
|
|
|
};
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace gl
|
|
|
|
} // namespace mozilla
|
2014-03-05 21:49:37 +00:00
|
|
|
|
2015-08-08 02:27:14 +00:00
|
|
|
#else // USE_SKIA_GPU
|
2014-03-05 21:49:37 +00: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-08 02:27:14 +00:00
|
|
|
} // namespace gl
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // USE_SKIA_GPU
|
|
|
|
|
|
|
|
#endif // SKIA_GL_GLUE_H_
|