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:
JerryShih
2017-05-18 22:59:06 +08:00
parent 567adbafd2
commit a87ebf2102
2 changed files with 0 additions and 109 deletions

View File

@@ -107,71 +107,5 @@ MacIOSurfaceTextureHostOGL::gl() const
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 mozilla