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