зеркало из https://github.com/mozilla/gecko-dev.git
Bug 935380 - Part 1: Remove INIT_MODE_COPY since it was invalid for callers to use it. r=nrc
This commit is contained in:
Родитель
61cf03dd1b
Коммит
a349950ad5
|
@ -125,8 +125,7 @@ class CompositingRenderTarget;
|
|||
enum SurfaceInitMode
|
||||
{
|
||||
INIT_MODE_NONE,
|
||||
INIT_MODE_CLEAR,
|
||||
INIT_MODE_COPY
|
||||
INIT_MODE_CLEAR
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -250,7 +250,6 @@ void BasicCompositor::Destroy()
|
|||
TemporaryRef<CompositingRenderTarget>
|
||||
BasicCompositor::CreateRenderTarget(const IntRect& aRect, SurfaceInitMode aInit)
|
||||
{
|
||||
MOZ_ASSERT(aInit != INIT_MODE_COPY);
|
||||
RefPtr<DrawTarget> target = mDrawTarget->CreateSimilarDrawTarget(aRect.Size(), FORMAT_B8G8R8A8);
|
||||
|
||||
RefPtr<BasicCompositingRenderTarget> rt = new BasicCompositingRenderTarget(target, aRect.Size());
|
||||
|
|
|
@ -131,9 +131,7 @@ ContainerRender(ContainerT* aContainer,
|
|||
// not safe.
|
||||
if (HasOpaqueAncestorLayer(aContainer) &&
|
||||
transform3D.Is2D(&transform) && !transform.HasNonIntegerTranslation()) {
|
||||
mode = gfxPlatform::ComponentAlphaEnabled() ?
|
||||
INIT_MODE_COPY : INIT_MODE_CLEAR;
|
||||
surfaceCopyNeeded = (mode == INIT_MODE_COPY);
|
||||
surfaceCopyNeeded = gfxPlatform::ComponentAlphaEnabled();
|
||||
surfaceRect.x += transform.x0;
|
||||
surfaceRect.y += transform.y0;
|
||||
aContainer->mSupportsComponentAlphaChildren
|
||||
|
|
|
@ -659,7 +659,7 @@ CompositorOGL::CreateRenderTarget(const IntRect &aRect, SurfaceInitMode aInit)
|
|||
{
|
||||
GLuint tex = 0;
|
||||
GLuint fbo = 0;
|
||||
CreateFBOWithTexture(aRect, aInit, 0, &fbo, &tex);
|
||||
CreateFBOWithTexture(aRect, false, 0, &fbo, &tex);
|
||||
RefPtr<CompositingRenderTargetOGL> surface
|
||||
= new CompositingRenderTargetOGL(this, tex, fbo);
|
||||
surface->Initialize(IntSize(aRect.width, aRect.height), mFBOTextureTarget, aInit);
|
||||
|
@ -675,10 +675,10 @@ CompositorOGL::CreateRenderTargetFromSource(const IntRect &aRect,
|
|||
const CompositingRenderTargetOGL* sourceSurface
|
||||
= static_cast<const CompositingRenderTargetOGL*>(aSource);
|
||||
if (aSource) {
|
||||
CreateFBOWithTexture(aRect, INIT_MODE_COPY, sourceSurface->GetFBO(),
|
||||
CreateFBOWithTexture(aRect, true, sourceSurface->GetFBO(),
|
||||
&fbo, &tex);
|
||||
} else {
|
||||
CreateFBOWithTexture(aRect, INIT_MODE_COPY, 0,
|
||||
CreateFBOWithTexture(aRect, true, 0,
|
||||
&fbo, &tex);
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ CompositorOGL::CreateRenderTargetFromSource(const IntRect &aRect,
|
|||
= new CompositingRenderTargetOGL(this, tex, fbo);
|
||||
surface->Initialize(IntSize(aRect.width, aRect.height),
|
||||
mFBOTextureTarget,
|
||||
INIT_MODE_COPY);
|
||||
INIT_MODE_NONE);
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
|
@ -841,7 +841,7 @@ CompositorOGL::BeginFrame(const Rect *aClipRectIn, const gfxMatrix& aTransform,
|
|||
}
|
||||
|
||||
void
|
||||
CompositorOGL::CreateFBOWithTexture(const IntRect& aRect, SurfaceInitMode aInit,
|
||||
CompositorOGL::CreateFBOWithTexture(const IntRect& aRect, bool aCopyFromSource,
|
||||
GLuint aSourceFrameBuffer,
|
||||
GLuint *aFBO, GLuint *aTexture)
|
||||
{
|
||||
|
@ -851,7 +851,7 @@ CompositorOGL::CreateFBOWithTexture(const IntRect& aRect, SurfaceInitMode aInit,
|
|||
mGLContext->fGenTextures(1, &tex);
|
||||
mGLContext->fBindTexture(mFBOTextureTarget, tex);
|
||||
|
||||
if (aInit == INIT_MODE_COPY) {
|
||||
if (aCopyFromSource) {
|
||||
GLuint curFBO = mCurrentRenderTarget->GetFBO();
|
||||
if (curFBO != aSourceFrameBuffer) {
|
||||
mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, aSourceFrameBuffer);
|
||||
|
|
|
@ -274,7 +274,7 @@ private:
|
|||
* shaders are required to sample from the different
|
||||
* texture types.
|
||||
*/
|
||||
void CreateFBOWithTexture(const gfx::IntRect& aRect, SurfaceInitMode aInit,
|
||||
void CreateFBOWithTexture(const gfx::IntRect& aRect, bool aCopyFromSource,
|
||||
GLuint aSourceFrameBuffer,
|
||||
GLuint *aFBO, GLuint *aTexture);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче