mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 03:35:33 +00:00
Bug 1362049 - Remove the unused MacIOSurfaceTextureSourceOGL. r=mattwoodrow
The MacIOSurfaceTextureSourceOGL doesn't be used in the codebase. MozReview-Commit-ID: EZ1fHw7J6YD
This commit is contained in:
parent
3774d02876
commit
49684e68a5
@ -107,71 +107,5 @@ MacIOSurfaceTextureHostOGL::gl() const
|
|||||||
return mProvider ? mProvider->GetGLContext() : nullptr;
|
return mProvider ? mProvider->GetGLContext() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MacIOSurfaceTextureSourceOGL::MacIOSurfaceTextureSourceOGL(
|
|
||||||
CompositorOGL* aCompositor,
|
|
||||||
MacIOSurface* aSurface)
|
|
||||||
: mCompositor(aCompositor)
|
|
||||||
, mSurface(aSurface)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aCompositor);
|
|
||||||
MOZ_COUNT_CTOR(MacIOSurfaceTextureSourceOGL);
|
|
||||||
}
|
|
||||||
|
|
||||||
MacIOSurfaceTextureSourceOGL::~MacIOSurfaceTextureSourceOGL()
|
|
||||||
{
|
|
||||||
MOZ_COUNT_DTOR(MacIOSurfaceTextureSourceOGL);
|
|
||||||
}
|
|
||||||
|
|
||||||
gfx::IntSize
|
|
||||||
MacIOSurfaceTextureSourceOGL::GetSize() const
|
|
||||||
{
|
|
||||||
return gfx::IntSize(mSurface->GetDevicePixelWidth(),
|
|
||||||
mSurface->GetDevicePixelHeight());
|
|
||||||
}
|
|
||||||
|
|
||||||
gfx::SurfaceFormat
|
|
||||||
MacIOSurfaceTextureSourceOGL::GetFormat() const
|
|
||||||
{
|
|
||||||
return mSurface->HasAlpha() ? gfx::SurfaceFormat::R8G8B8A8
|
|
||||||
: gfx::SurfaceFormat::R8G8B8X8;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
MacIOSurfaceTextureSourceOGL::BindTexture(GLenum aTextureUnit,
|
|
||||||
gfx::SamplingFilter aSamplingFilter)
|
|
||||||
{
|
|
||||||
gl::GLContext* gl = this->gl();
|
|
||||||
if (!gl || !gl->MakeCurrent()) {
|
|
||||||
NS_WARNING("Trying to bind a texture without a working GLContext");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GLuint tex = mCompositor->GetTemporaryTexture(GetTextureTarget(), aTextureUnit);
|
|
||||||
|
|
||||||
gl->fActiveTexture(aTextureUnit);
|
|
||||||
gl->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, tex);
|
|
||||||
mSurface->CGLTexImageIOSurface2D(gl::GLContextCGL::Cast(gl)->GetCGLContext());
|
|
||||||
ApplySamplingFilterToBoundTexture(gl, aSamplingFilter, LOCAL_GL_TEXTURE_RECTANGLE_ARB);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
MacIOSurfaceTextureSourceOGL::SetTextureSourceProvider(TextureSourceProvider* aProvider)
|
|
||||||
{
|
|
||||||
CompositorOGL* ogl = nullptr;
|
|
||||||
if (Compositor* compositor = aProvider->AsCompositor()) {
|
|
||||||
ogl = compositor->AsCompositorOGL();
|
|
||||||
}
|
|
||||||
|
|
||||||
mCompositor = ogl;
|
|
||||||
if (mCompositor && mNextSibling) {
|
|
||||||
mNextSibling->SetTextureSourceProvider(aProvider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gl::GLContext*
|
|
||||||
MacIOSurfaceTextureSourceOGL::gl() const
|
|
||||||
{
|
|
||||||
return mCompositor ? mCompositor->gl() : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -14,49 +14,6 @@ class MacIOSurface;
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
/**
|
|
||||||
* A texture source meant for use with MacIOSurfaceTextureHostOGL.
|
|
||||||
*
|
|
||||||
* It does not own any GL texture, and attaches its shared handle to one of
|
|
||||||
* the compositor's temporary textures when binding.
|
|
||||||
*/
|
|
||||||
class MacIOSurfaceTextureSourceOGL : public TextureSource
|
|
||||||
, public TextureSourceOGL
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
MacIOSurfaceTextureSourceOGL(CompositorOGL* aCompositor,
|
|
||||||
MacIOSurface* aSurface);
|
|
||||||
virtual ~MacIOSurfaceTextureSourceOGL();
|
|
||||||
|
|
||||||
virtual const char* Name() const override { return "MacIOSurfaceTextureSourceOGL"; }
|
|
||||||
|
|
||||||
virtual TextureSourceOGL* AsSourceOGL() override { return this; }
|
|
||||||
|
|
||||||
virtual void BindTexture(GLenum activetex,
|
|
||||||
gfx::SamplingFilter aSamplingFilter) override;
|
|
||||||
|
|
||||||
virtual bool IsValid() const override { return !!gl(); }
|
|
||||||
|
|
||||||
virtual gfx::IntSize GetSize() const override;
|
|
||||||
|
|
||||||
virtual gfx::SurfaceFormat GetFormat() const override;
|
|
||||||
|
|
||||||
virtual GLenum GetTextureTarget() const override { return LOCAL_GL_TEXTURE_RECTANGLE_ARB; }
|
|
||||||
|
|
||||||
virtual GLenum GetWrapMode() const override { return LOCAL_GL_CLAMP_TO_EDGE; }
|
|
||||||
|
|
||||||
// MacIOSurfaceTextureSourceOGL doesn't own any gl texture
|
|
||||||
virtual void DeallocateDeviceData() override {}
|
|
||||||
|
|
||||||
virtual void SetTextureSourceProvider(TextureSourceProvider* aProvider) override;
|
|
||||||
|
|
||||||
gl::GLContext* gl() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
RefPtr<CompositorOGL> mCompositor;
|
|
||||||
RefPtr<MacIOSurface> mSurface;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A TextureHost for shared MacIOSurface
|
* A TextureHost for shared MacIOSurface
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user