2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 4; -*- */
|
2014-03-06 01:49:37 +04:00
|
|
|
/* 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
|
|
|
|
|
2016-10-25 05:40:59 +03:00
|
|
|
#include "skia/include/core/SkRefCnt.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2015-08-08 05:27:14 +03:00
|
|
|
|
|
|
|
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:
|
2017-11-06 06:37:28 +03:00
|
|
|
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SkiaGLGlue, override)
|
|
|
|
|
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:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<GLContext> mGLContext;
|
2016-10-25 05:40:59 +03:00
|
|
|
sk_sp<GrGLInterface> mGrGLInterface;
|
|
|
|
sk_sp<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_
|