2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2017-03-31 17:29:14 +03:00
|
|
|
* 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/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_RENDERTEXTUREHOST_H
|
|
|
|
#define MOZILLA_GFX_RENDERTEXTUREHOST_H
|
|
|
|
|
2018-09-03 22:43:31 +03:00
|
|
|
#include "GLConsts.h"
|
2017-03-31 17:29:14 +03:00
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
#include "mozilla/gfx/2D.h"
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h"
|
|
|
|
#include "mozilla/RefPtr.h"
|
2018-09-03 22:43:31 +03:00
|
|
|
#include "mozilla/webrender/webrender_ffi.h" // for wr::ImageRendering
|
2017-03-31 17:29:14 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2017-10-30 20:10:29 +03:00
|
|
|
|
|
|
|
namespace gl {
|
|
|
|
class GLContext;
|
|
|
|
}
|
|
|
|
|
2017-03-31 17:29:14 +03:00
|
|
|
namespace wr {
|
|
|
|
|
|
|
|
class RenderBufferTextureHost;
|
|
|
|
class RenderTextureHostOGL;
|
2018-07-25 17:30:08 +03:00
|
|
|
class RenderTextureHostWrapper;
|
2017-03-31 17:29:14 +03:00
|
|
|
|
2018-09-03 22:43:31 +03:00
|
|
|
void
|
|
|
|
ActivateBindAndTexParameteri(gl::GLContext* aGL,
|
|
|
|
GLenum aActiveTexture,
|
|
|
|
GLenum aBindTarget,
|
|
|
|
GLuint aBindTexture,
|
|
|
|
wr::ImageRendering aRendering);
|
|
|
|
|
2017-03-31 17:29:14 +03:00
|
|
|
class RenderTextureHost
|
|
|
|
{
|
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RenderTextureHost)
|
|
|
|
|
|
|
|
public:
|
|
|
|
RenderTextureHost();
|
|
|
|
|
2018-09-03 22:43:31 +03:00
|
|
|
virtual wr::WrExternalImage Lock(uint8_t aChannelIndex,
|
|
|
|
gl::GLContext* aGL,
|
|
|
|
wr::ImageRendering aRendering) = 0;
|
2017-03-31 17:29:14 +03:00
|
|
|
virtual void Unlock() = 0;
|
2018-06-13 18:01:06 +03:00
|
|
|
virtual void ClearCachedResources() {}
|
2018-07-25 17:30:08 +03:00
|
|
|
|
|
|
|
virtual RenderTextureHostWrapper* AsRenderTextureHostWrapper() { return nullptr; }
|
2018-09-03 22:43:31 +03:00
|
|
|
|
2017-03-31 17:29:14 +03:00
|
|
|
protected:
|
|
|
|
virtual ~RenderTextureHost();
|
2018-09-03 22:43:31 +03:00
|
|
|
|
|
|
|
bool IsFilterUpdateNecessary(wr::ImageRendering aRendering);
|
|
|
|
|
|
|
|
wr::ImageRendering mCachedRendering;
|
2017-03-31 17:29:14 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace wr
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // MOZILLA_GFX_RENDERTEXTUREHOST_H
|