mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 976813 - Separate ShSurf::Texture for Prod and Cons. - r=snorp
This commit is contained in:
parent
0c15e4a428
commit
8f53ae3993
@ -23,6 +23,7 @@
|
||||
#include "prenv.h"
|
||||
#include "prlink.h"
|
||||
#include "ScopedGLHelpers.h"
|
||||
#include "SharedSurfaceGL.h"
|
||||
#include "SurfaceStream.h"
|
||||
#include "GfxTexturesReporter.h"
|
||||
#include "TextureGarbageBin.h"
|
||||
@ -1564,12 +1565,16 @@ GLContext::PublishFrame()
|
||||
return true;
|
||||
}
|
||||
|
||||
SharedSurface*
|
||||
SharedSurface_GL*
|
||||
GLContext::RequestFrame()
|
||||
{
|
||||
MOZ_ASSERT(mScreen);
|
||||
|
||||
return mScreen->Stream()->SwapConsumer();
|
||||
SharedSurface* ret = mScreen->Stream()->SwapConsumer();
|
||||
if (!ret)
|
||||
return nullptr;
|
||||
|
||||
return SharedSurface_GL::Cast(ret);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,7 +57,6 @@ namespace android {
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
class SharedSurface;
|
||||
class SourceSurface;
|
||||
class DataSourceSurface;
|
||||
struct SurfaceCaps;
|
||||
@ -71,6 +70,7 @@ namespace mozilla {
|
||||
class GLBlitHelper;
|
||||
class GLBlitTextureImageHelper;
|
||||
class GLReadTexImageHelper;
|
||||
class SharedSurface_GL;
|
||||
}
|
||||
|
||||
namespace layers {
|
||||
@ -2825,20 +2825,20 @@ protected:
|
||||
|
||||
void DestroyScreenBuffer();
|
||||
|
||||
SharedSurface* mLockedSurface;
|
||||
SharedSurface_GL* mLockedSurface;
|
||||
|
||||
public:
|
||||
void LockSurface(SharedSurface* surf) {
|
||||
void LockSurface(SharedSurface_GL* surf) {
|
||||
MOZ_ASSERT(!mLockedSurface);
|
||||
mLockedSurface = surf;
|
||||
}
|
||||
|
||||
void UnlockSurface(SharedSurface* surf) {
|
||||
void UnlockSurface(SharedSurface_GL* surf) {
|
||||
MOZ_ASSERT(mLockedSurface == surf);
|
||||
mLockedSurface = nullptr;
|
||||
}
|
||||
|
||||
SharedSurface* GetLockedSurface() const {
|
||||
SharedSurface_GL* GetLockedSurface() const {
|
||||
return mLockedSurface;
|
||||
}
|
||||
|
||||
@ -2851,7 +2851,7 @@ public:
|
||||
}
|
||||
|
||||
bool PublishFrame();
|
||||
SharedSurface* RequestFrame();
|
||||
SharedSurface_GL* RequestFrame();
|
||||
|
||||
/* Clear to transparent black, with 0 depth and stencil,
|
||||
* while preserving current ClearColor etc. values.
|
||||
|
@ -623,11 +623,11 @@ ReadBuffer::Create(GLContext* gl,
|
||||
|
||||
switch (surf->AttachType()) {
|
||||
case AttachmentType::GLTexture:
|
||||
colorTex = surf->Texture();
|
||||
target = surf->TextureTarget();
|
||||
colorTex = surf->ProdTexture();
|
||||
target = surf->ProdTextureTarget();
|
||||
break;
|
||||
case AttachmentType::GLRenderbuffer:
|
||||
colorRB = surf->Renderbuffer();
|
||||
colorRB = surf->ProdRenderbuffer();
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unknown attachment type?");
|
||||
@ -676,11 +676,11 @@ ReadBuffer::Attach(SharedSurface_GL* surf)
|
||||
|
||||
switch (surf->AttachType()) {
|
||||
case AttachmentType::GLTexture:
|
||||
colorTex = surf->Texture();
|
||||
target = surf->TextureTarget();
|
||||
colorTex = surf->ProdTexture();
|
||||
target = surf->ProdTextureTarget();
|
||||
break;
|
||||
case AttachmentType::GLRenderbuffer:
|
||||
colorRB = surf->Renderbuffer();
|
||||
colorRB = surf->ProdRenderbuffer();
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unknown attachment type?");
|
||||
|
@ -22,7 +22,7 @@ SharedSurface::Copy(SharedSurface* src, SharedSurface* dest, SurfaceFactory* fac
|
||||
SharedSurface_GL* srcGL = (SharedSurface_GL*)src;
|
||||
SharedSurface_GL* destGL = (SharedSurface_GL*)dest;
|
||||
|
||||
SharedSurface_GL::Copy(srcGL, destGL, (SurfaceFactory_GL*)factory);
|
||||
SharedSurface_GL::ProdCopy(srcGL, destGL, (SurfaceFactory_GL*)factory);
|
||||
}
|
||||
|
||||
} /* namespace gfx */
|
||||
|
@ -100,22 +100,6 @@ public:
|
||||
bool HasAlpha() const {
|
||||
return mHasAlpha;
|
||||
}
|
||||
|
||||
|
||||
// For use when AttachType is correct.
|
||||
virtual GLuint Texture() const {
|
||||
MOZ_ASSERT(AttachType() == AttachmentType::GLTexture);
|
||||
MOZ_CRASH("Did you forget to override this function?");
|
||||
}
|
||||
|
||||
virtual GLenum TextureTarget() const {
|
||||
return Texture() ? LOCAL_GL_TEXTURE_2D : 0;
|
||||
}
|
||||
|
||||
virtual GLuint Renderbuffer() const {
|
||||
MOZ_ASSERT(AttachType() == AttachmentType::GLRenderbuffer);
|
||||
MOZ_CRASH("Did you forget to override this function?");
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace gfx */
|
||||
|
@ -66,11 +66,11 @@ protected:
|
||||
public:
|
||||
virtual ~SharedSurface_ANGLEShareHandle();
|
||||
|
||||
virtual void LockProdImpl();
|
||||
virtual void UnlockProdImpl();
|
||||
virtual void LockProdImpl() MOZ_OVERRIDE;
|
||||
virtual void UnlockProdImpl() MOZ_OVERRIDE;
|
||||
|
||||
virtual void Fence();
|
||||
virtual bool WaitSync();
|
||||
virtual void Fence() MOZ_OVERRIDE;
|
||||
virtual bool WaitSync() MOZ_OVERRIDE;
|
||||
|
||||
// Implementation-specific functions below:
|
||||
ID3D10ShaderResourceView* GetSRV() {
|
||||
@ -101,7 +101,7 @@ protected:
|
||||
ID3D10Device1* d3d,
|
||||
const SurfaceCaps& caps);
|
||||
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) {
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) MOZ_OVERRIDE {
|
||||
bool hasAlpha = mReadCaps.alpha;
|
||||
return SharedSurface_ANGLEShareHandle::Create(mProdGL, mConsD3D,
|
||||
mContext, mConfig,
|
||||
|
@ -57,21 +57,20 @@ protected:
|
||||
EGLImage image);
|
||||
|
||||
EGLDisplay Display() const;
|
||||
|
||||
void UpdateProdTexture(const MutexAutoLock& curAutoLock);
|
||||
|
||||
public:
|
||||
virtual ~SharedSurface_EGLImage();
|
||||
|
||||
virtual void LockProdImpl() {}
|
||||
virtual void UnlockProdImpl() {}
|
||||
virtual void LockProdImpl() MOZ_OVERRIDE {}
|
||||
virtual void UnlockProdImpl() MOZ_OVERRIDE {}
|
||||
|
||||
|
||||
virtual void Fence();
|
||||
virtual bool WaitSync();
|
||||
virtual void Fence() MOZ_OVERRIDE;
|
||||
virtual bool WaitSync() MOZ_OVERRIDE;
|
||||
|
||||
|
||||
virtual GLuint Texture() const {
|
||||
return mProdTex;
|
||||
virtual GLuint ProdTexture() MOZ_OVERRIDE {
|
||||
return mProdTex;
|
||||
}
|
||||
|
||||
// Implementation-specific functions below:
|
||||
@ -100,7 +99,7 @@ protected:
|
||||
{}
|
||||
|
||||
public:
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) {
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) MOZ_OVERRIDE {
|
||||
bool hasAlpha = mReadCaps.alpha;
|
||||
return SharedSurface_EGLImage::Create(mGL, mFormats, size, hasAlpha, mContext);
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ namespace gl {
|
||||
// |src| must begin and end locked, though we may
|
||||
// temporarily unlock it if we need to.
|
||||
void
|
||||
SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
SurfaceFactory_GL* factory)
|
||||
SharedSurface_GL::ProdCopy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
SurfaceFactory_GL* factory)
|
||||
{
|
||||
GLContext* gl = src->GL();
|
||||
|
||||
@ -34,13 +34,13 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
src->Size(),
|
||||
factory->Caps().alpha));
|
||||
|
||||
Copy(src, tempSurf, factory);
|
||||
Copy(tempSurf, dest, factory);
|
||||
ProdCopy(src, tempSurf, factory);
|
||||
ProdCopy(tempSurf, dest, factory);
|
||||
return;
|
||||
}
|
||||
|
||||
if (src->AttachType() == AttachmentType::Screen) {
|
||||
SharedSurface* origLocked = gl->GetLockedSurface();
|
||||
SharedSurface_GL* origLocked = gl->GetLockedSurface();
|
||||
bool srcNeedsUnlock = false;
|
||||
bool origNeedsRelock = false;
|
||||
if (origLocked != src) {
|
||||
@ -54,12 +54,12 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
}
|
||||
|
||||
if (dest->AttachType() == AttachmentType::GLTexture) {
|
||||
GLuint destTex = dest->Texture();
|
||||
GLenum destTarget = dest->TextureTarget();
|
||||
GLuint destTex = dest->ProdTexture();
|
||||
GLenum destTarget = dest->ProdTextureTarget();
|
||||
|
||||
gl->BlitHelper()->BlitFramebufferToTexture(0, destTex, src->Size(), dest->Size(), destTarget);
|
||||
} else if (dest->AttachType() == AttachmentType::GLRenderbuffer) {
|
||||
GLuint destRB = dest->Renderbuffer();
|
||||
GLuint destRB = dest->ProdRenderbuffer();
|
||||
ScopedFramebufferForRenderbuffer destWrapper(gl, destRB);
|
||||
|
||||
gl->BlitHelper()->BlitFramebufferToFramebuffer(0, destWrapper.FB(),
|
||||
@ -78,7 +78,7 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
}
|
||||
|
||||
if (dest->AttachType() == AttachmentType::Screen) {
|
||||
SharedSurface* origLocked = gl->GetLockedSurface();
|
||||
SharedSurface_GL* origLocked = gl->GetLockedSurface();
|
||||
bool destNeedsUnlock = false;
|
||||
bool origNeedsRelock = false;
|
||||
if (origLocked != dest) {
|
||||
@ -92,12 +92,12 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
}
|
||||
|
||||
if (src->AttachType() == AttachmentType::GLTexture) {
|
||||
GLuint srcTex = src->Texture();
|
||||
GLenum srcTarget = src->TextureTarget();
|
||||
GLuint srcTex = src->ProdTexture();
|
||||
GLenum srcTarget = src->ProdTextureTarget();
|
||||
|
||||
gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, 0, src->Size(), dest->Size(), srcTarget);
|
||||
} else if (src->AttachType() == AttachmentType::GLRenderbuffer) {
|
||||
GLuint srcRB = src->Renderbuffer();
|
||||
GLuint srcRB = src->ProdRenderbuffer();
|
||||
ScopedFramebufferForRenderbuffer srcWrapper(gl, srcRB);
|
||||
|
||||
gl->BlitHelper()->BlitFramebufferToFramebuffer(srcWrapper.FB(), 0,
|
||||
@ -119,12 +119,12 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
// Only {src,dest}x{texture,renderbuffer} left.
|
||||
|
||||
if (src->AttachType() == AttachmentType::GLTexture) {
|
||||
GLuint srcTex = src->Texture();
|
||||
GLenum srcTarget = src->TextureTarget();
|
||||
GLuint srcTex = src->ProdTexture();
|
||||
GLenum srcTarget = src->ProdTextureTarget();
|
||||
|
||||
if (dest->AttachType() == AttachmentType::GLTexture) {
|
||||
GLuint destTex = dest->Texture();
|
||||
GLenum destTarget = dest->TextureTarget();
|
||||
GLuint destTex = dest->ProdTexture();
|
||||
GLenum destTarget = dest->ProdTextureTarget();
|
||||
|
||||
gl->BlitHelper()->BlitTextureToTexture(srcTex, destTex,
|
||||
src->Size(), dest->Size(),
|
||||
@ -134,7 +134,7 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
}
|
||||
|
||||
if (dest->AttachType() == AttachmentType::GLRenderbuffer) {
|
||||
GLuint destRB = dest->Renderbuffer();
|
||||
GLuint destRB = dest->ProdRenderbuffer();
|
||||
ScopedFramebufferForRenderbuffer destWrapper(gl, destRB);
|
||||
|
||||
gl->BlitHelper()->BlitTextureToFramebuffer(srcTex, destWrapper.FB(),
|
||||
@ -147,12 +147,12 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
}
|
||||
|
||||
if (src->AttachType() == AttachmentType::GLRenderbuffer) {
|
||||
GLuint srcRB = src->Renderbuffer();
|
||||
GLuint srcRB = src->ProdRenderbuffer();
|
||||
ScopedFramebufferForRenderbuffer srcWrapper(gl, srcRB);
|
||||
|
||||
if (dest->AttachType() == AttachmentType::GLTexture) {
|
||||
GLuint destTex = dest->Texture();
|
||||
GLenum destTarget = dest->TextureTarget();
|
||||
GLuint destTex = dest->ProdTexture();
|
||||
GLenum destTarget = dest->ProdTextureTarget();
|
||||
|
||||
gl->BlitHelper()->BlitFramebufferToTexture(srcWrapper.FB(), destTex,
|
||||
src->Size(), dest->Size(), destTarget);
|
||||
@ -161,7 +161,7 @@ SharedSurface_GL::Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
}
|
||||
|
||||
if (dest->AttachType() == AttachmentType::GLRenderbuffer) {
|
||||
GLuint destRB = dest->Renderbuffer();
|
||||
GLuint destRB = dest->ProdRenderbuffer();
|
||||
ScopedFramebufferForRenderbuffer destWrapper(gl, destRB);
|
||||
|
||||
gl->BlitHelper()->BlitFramebufferToFramebuffer(srcWrapper.FB(), destWrapper.FB(),
|
||||
|
@ -54,8 +54,8 @@ protected:
|
||||
{}
|
||||
|
||||
public:
|
||||
static void Copy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
SurfaceFactory_GL* factory);
|
||||
static void ProdCopy(SharedSurface_GL* src, SharedSurface_GL* dest,
|
||||
SurfaceFactory_GL* factory);
|
||||
|
||||
static SharedSurface_GL* Cast(SharedSurface* surf) {
|
||||
MOZ_ASSERT(surf->APIType() == APITypeT::OpenGL);
|
||||
@ -63,13 +63,28 @@ public:
|
||||
return (SharedSurface_GL*)surf;
|
||||
}
|
||||
|
||||
// For use when AttachType is correct.
|
||||
virtual GLuint ProdTexture() {
|
||||
MOZ_ASSERT(AttachType() == AttachmentType::GLTexture);
|
||||
MOZ_CRASH("Did you forget to override this function?");
|
||||
}
|
||||
|
||||
virtual GLenum ProdTextureTarget() const {
|
||||
return LOCAL_GL_TEXTURE_2D;
|
||||
}
|
||||
|
||||
virtual GLuint ProdRenderbuffer() {
|
||||
MOZ_ASSERT(AttachType() == AttachmentType::GLRenderbuffer);
|
||||
MOZ_CRASH("Did you forget to override this function?");
|
||||
}
|
||||
|
||||
virtual bool ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, GLvoid *pixels) {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void LockProd();
|
||||
virtual void UnlockProd();
|
||||
virtual void LockProd() MOZ_OVERRIDE;
|
||||
virtual void UnlockProd() MOZ_OVERRIDE;
|
||||
|
||||
GLContext* GL() const {
|
||||
return mGL;
|
||||
@ -149,19 +164,18 @@ protected:
|
||||
public:
|
||||
virtual ~SharedSurface_Basic();
|
||||
|
||||
virtual void LockProdImpl() {}
|
||||
virtual void UnlockProdImpl() {}
|
||||
virtual void LockProdImpl() MOZ_OVERRIDE {}
|
||||
virtual void UnlockProdImpl() MOZ_OVERRIDE {}
|
||||
|
||||
|
||||
virtual void Fence();
|
||||
virtual void Fence() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool WaitSync() {
|
||||
virtual bool WaitSync() MOZ_OVERRIDE {
|
||||
// Since we already store the data in Fence, we're always done already.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
virtual GLuint Texture() const {
|
||||
virtual GLuint ProdTexture() MOZ_OVERRIDE {
|
||||
return mTex;
|
||||
}
|
||||
|
||||
@ -179,7 +193,7 @@ public:
|
||||
: SurfaceFactory_GL(gl, SharedSurfaceType::Basic, caps)
|
||||
{}
|
||||
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) {
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) MOZ_OVERRIDE {
|
||||
bool hasAlpha = mReadCaps.alpha;
|
||||
return SharedSurface_Basic::Create(mGL, mFormats, size, hasAlpha);
|
||||
}
|
||||
@ -233,15 +247,15 @@ protected:
|
||||
public:
|
||||
virtual ~SharedSurface_GLTexture();
|
||||
|
||||
virtual void LockProdImpl() {}
|
||||
virtual void UnlockProdImpl() {}
|
||||
virtual void LockProdImpl() MOZ_OVERRIDE {}
|
||||
virtual void UnlockProdImpl() MOZ_OVERRIDE {}
|
||||
|
||||
|
||||
virtual void Fence();
|
||||
virtual bool WaitSync();
|
||||
virtual void Fence() MOZ_OVERRIDE;
|
||||
virtual bool WaitSync() MOZ_OVERRIDE;
|
||||
|
||||
|
||||
virtual GLuint Texture() const {
|
||||
virtual GLuint ProdTexture() MOZ_OVERRIDE {
|
||||
return mTex;
|
||||
}
|
||||
|
||||
@ -268,7 +282,7 @@ public:
|
||||
MOZ_ASSERT(consGL != prodGL);
|
||||
}
|
||||
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) {
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) MOZ_OVERRIDE {
|
||||
bool hasAlpha = mReadCaps.alpha;
|
||||
return SharedSurface_GLTexture::Create(mGL, mConsGL, mFormats, size, hasAlpha);
|
||||
}
|
||||
|
@ -152,14 +152,3 @@ SharedSurface_Gralloc::WaitSync()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
SharedSurface_Gralloc::LockProdImpl()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
SharedSurface_Gralloc::UnlockProdImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -65,13 +65,13 @@ protected:
|
||||
public:
|
||||
virtual ~SharedSurface_Gralloc();
|
||||
|
||||
virtual void Fence();
|
||||
virtual bool WaitSync();
|
||||
virtual void Fence() MOZ_OVERRIDE;
|
||||
virtual bool WaitSync() MOZ_OVERRIDE;
|
||||
|
||||
virtual void LockProdImpl();
|
||||
virtual void UnlockProdImpl();
|
||||
virtual void LockProdImpl() MOZ_OVERRIDE {}
|
||||
virtual void UnlockProdImpl() MOZ_OVERRIDE {}
|
||||
|
||||
virtual GLuint Texture() const {
|
||||
virtual GLuint ProdTexture() MOZ_OVERRIDE {
|
||||
return mProdTex;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
const SurfaceCaps& caps,
|
||||
layers::ISurfaceAllocator* allocator = nullptr);
|
||||
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) {
|
||||
virtual SharedSurface* CreateShared(const gfx::IntSize& size) MOZ_OVERRIDE {
|
||||
bool hasAlpha = mReadCaps.alpha;
|
||||
if (!mAllocator) {
|
||||
return nullptr;
|
||||
|
@ -21,26 +21,24 @@ public:
|
||||
|
||||
~SharedSurface_IOSurface();
|
||||
|
||||
virtual void LockProdImpl() { }
|
||||
virtual void UnlockProdImpl() { }
|
||||
virtual void LockProdImpl() MOZ_OVERRIDE { }
|
||||
virtual void UnlockProdImpl() MOZ_OVERRIDE { }
|
||||
|
||||
virtual void Fence();
|
||||
virtual bool WaitSync() { return true; }
|
||||
virtual void Fence() MOZ_OVERRIDE;
|
||||
virtual bool WaitSync() MOZ_OVERRIDE { return true; }
|
||||
|
||||
virtual bool ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, GLvoid *pixels) MOZ_OVERRIDE;
|
||||
|
||||
virtual GLuint Texture() const
|
||||
{
|
||||
virtual GLuint ProdTexture() MOZ_OVERRIDE {
|
||||
return mTexture;
|
||||
}
|
||||
|
||||
virtual GLenum TextureTarget() const {
|
||||
virtual GLenum ProdTextureTarget() const MOZ_OVERRIDE {
|
||||
return LOCAL_GL_TEXTURE_RECTANGLE_ARB;
|
||||
}
|
||||
|
||||
static SharedSurface_IOSurface* Cast(SharedSurface *surf)
|
||||
{
|
||||
static SharedSurface_IOSurface* Cast(SharedSurface *surf) {
|
||||
MOZ_ASSERT(surf->Type() == SharedSurfaceType::IOSurface);
|
||||
return static_cast<SharedSurface_IOSurface*>(surf);
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ CopyableCanvasLayer::UpdateTarget(DrawTarget* aDestTarget,
|
||||
RefPtr<DataSourceSurface> readSurf;
|
||||
RefPtr<SourceSurface> resultSurf;
|
||||
|
||||
SharedSurface* sharedSurf = mGLContext->RequestFrame();
|
||||
SharedSurface_GL* sharedSurf = mGLContext->RequestFrame();
|
||||
if (!sharedSurf) {
|
||||
NS_WARNING("Null frame received.");
|
||||
return;
|
||||
@ -192,7 +192,7 @@ CopyableCanvasLayer::DeprecatedUpdateSurface(gfxASurface* aDestSurface,
|
||||
RefPtr<DataSourceSurface> readDSurf;
|
||||
nsRefPtr<gfxASurface> resultSurf;
|
||||
|
||||
SharedSurface* sharedSurf = mGLContext->RequestFrame();
|
||||
SharedSurface_GL* sharedSurf = mGLContext->RequestFrame();
|
||||
if (!sharedSurf) {
|
||||
NS_WARNING("Null frame received.");
|
||||
return;
|
||||
@ -350,7 +350,7 @@ CopyableCanvasLayer::DeprecatedPaintWithOpacity(gfxContext* aContext,
|
||||
// Restore surface operator
|
||||
if (GetContentFlags() & CONTENT_OPAQUE) {
|
||||
aContext->SetOperator(savedOp);
|
||||
}
|
||||
}
|
||||
|
||||
if (mNeedsYFlip) {
|
||||
aContext->SetMatrix(m);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include "SurfaceStream.h"
|
||||
#include "SharedSurfaceANGLE.h"
|
||||
#include "SharedSurfaceGL.h"
|
||||
#include "gfxContext.h"
|
||||
#include "GLContext.h"
|
||||
#include "gfxPrefs.h"
|
||||
@ -78,8 +79,8 @@ CanvasLayerD3D10::Initialize(const Data& aData)
|
||||
mBounds.SetRect(0, 0, aData.mSize.width, aData.mSize.height);
|
||||
device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRView));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// XXX we should store mDrawTarget and use it directly in UpdateSurface,
|
||||
// bypassing Thebes
|
||||
mSurface = mDrawTarget->Snapshot();
|
||||
@ -118,7 +119,7 @@ CanvasLayerD3D10::UpdateSurface()
|
||||
}
|
||||
|
||||
if (mGLContext) {
|
||||
SharedSurface* surf = mGLContext->RequestFrame();
|
||||
SharedSurface_GL* surf = mGLContext->RequestFrame();
|
||||
if (!surf)
|
||||
return;
|
||||
|
||||
|
@ -81,7 +81,7 @@ CanvasLayerD3D9::UpdateSurface()
|
||||
RefPtr<SourceSurface> surface;
|
||||
|
||||
if (mGLContext) {
|
||||
SharedSurface* surf = mGLContext->RequestFrame();
|
||||
SharedSurface_GL* surf = mGLContext->RequestFrame();
|
||||
if (!surf)
|
||||
return;
|
||||
|
||||
@ -131,7 +131,7 @@ CanvasLayerD3D9::RenderLayer()
|
||||
return;
|
||||
|
||||
/*
|
||||
* We flip the Y axis here, note we can only do this because we are in
|
||||
* We flip the Y axis here, note we can only do this because we are in
|
||||
* CULL_NONE mode!
|
||||
*/
|
||||
|
||||
|
@ -504,8 +504,8 @@ StreamTextureSourceOGL::RetrieveTextureFromStream()
|
||||
case SharedSurfaceType::GLTextureShare: {
|
||||
SharedSurface_GLTexture* glTexSurf = SharedSurface_GLTexture::Cast(sharedSurf);
|
||||
glTexSurf->SetConsumerGL(gl());
|
||||
mTextureHandle = glTexSurf->Texture();
|
||||
mTextureTarget = glTexSurf->TextureTarget();
|
||||
mTextureHandle = glTexSurf->ProdTexture();
|
||||
mTextureTarget = glTexSurf->ProdTextureTarget();
|
||||
MOZ_ASSERT(mTextureHandle);
|
||||
mFormat = sharedSurf->HasAlpha() ? SurfaceFormat::R8G8B8A8
|
||||
: SurfaceFormat::R8G8B8X8;
|
||||
@ -524,8 +524,8 @@ StreamTextureSourceOGL::RetrieveTextureFromStream()
|
||||
#ifdef XP_MACOSX
|
||||
case SharedSurfaceType::IOSurface: {
|
||||
SharedSurface_IOSurface* glTexSurf = SharedSurface_IOSurface::Cast(sharedSurf);
|
||||
mTextureHandle = glTexSurf->Texture();
|
||||
mTextureTarget = glTexSurf->TextureTarget();
|
||||
mTextureHandle = glTexSurf->ProdTexture();
|
||||
mTextureTarget = glTexSurf->ProdTextureTarget();
|
||||
MOZ_ASSERT(mTextureHandle);
|
||||
mFormat = sharedSurf->HasAlpha() ? SurfaceFormat::R8G8B8A8
|
||||
: SurfaceFormat::R8G8B8X8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user