diff --git a/gfx/layers/CompositorTypes.h b/gfx/layers/CompositorTypes.h index 42ac20100fe..e1b106a4bd6 100644 --- a/gfx/layers/CompositorTypes.h +++ b/gfx/layers/CompositorTypes.h @@ -26,18 +26,18 @@ const SurfaceDescriptorType SURFACEDESCRIPTOR_UNKNOWN = 0; */ typedef uint32_t TextureFlags; // Use nearest-neighbour texture filtering (as opposed to linear filtering). -const TextureFlags UseNearestFilter = 1 << 0; +const TextureFlags TEXTURE_USE_NEAREST_FILTER = 1 << 0; // The texture should be flipped around the y-axis when composited. -const TextureFlags NeedsYFlip = 1 << 1; +const TextureFlags TEXTURE_NEEDS_Y_FLIP = 1 << 1; // Force the texture to be represented using a single tile (note that this means // tiled textures, not tiled layers). const TextureFlags TEXTURE_DISALLOW_BIGIMAGE = 1 << 2; // Allow using 'repeat' mode for wrapping. -const TextureFlags AllowRepeat = 1 << 3; +const TextureFlags TEXTURE_ALLOW_REPEAT = 1 << 3; // The texture represents a tile which is newly created. -const TextureFlags NewTile = 1 << 4; +const TextureFlags TEXTURE_NEW_TILE = 1 << 4; // The texture is part of a component-alpha pair -const TextureFlags ComponentAlpha = 1 << 5; +const TextureFlags TEXTURE_COMPONENT_ALPHA = 1 << 5; // The buffer will be treated as if the RB bytes are swapped. // This is useful for rendering using Cairo/Thebes, because there is no // BGRX Android pixel format, and so we have to do byte swapping. diff --git a/gfx/layers/LayersLogging.cpp b/gfx/layers/LayersLogging.cpp index 45d52d0a6e5..90e9bc84d09 100644 --- a/gfx/layers/LayersLogging.cpp +++ b/gfx/layers/LayersLogging.cpp @@ -210,11 +210,11 @@ AppendToString(nsACString& s, TextureFlags flags, } \ } bool previous = false; - AppendFlag(UseNearestFilter); - AppendFlag(NeedsYFlip); + AppendFlag(TEXTURE_USE_NEAREST_FILTER); + AppendFlag(TEXTURE_NEEDS_Y_FLIP); AppendFlag(TEXTURE_DISALLOW_BIGIMAGE); - AppendFlag(AllowRepeat); - AppendFlag(NewTile); + AppendFlag(TEXTURE_ALLOW_REPEAT); + AppendFlag(TEXTURE_NEW_TILE); AppendFlag(TEXTURE_DEALLOCATE_HOST); #undef AppendFlag diff --git a/gfx/layers/client/ClientCanvasLayer.cpp b/gfx/layers/client/ClientCanvasLayer.cpp index 258abb27834..1d8ad3e4cee 100644 --- a/gfx/layers/client/ClientCanvasLayer.cpp +++ b/gfx/layers/client/ClientCanvasLayer.cpp @@ -83,7 +83,7 @@ ClientCanvasLayer::RenderLayer() if (!mCanvasClient) { TextureFlags flags = TEXTURE_IMMEDIATE_UPLOAD; if (mNeedsYFlip) { - flags |= NeedsYFlip; + flags |= TEXTURE_NEEDS_Y_FLIP; } bool isCrossProcess = !(XRE_GetProcessType() == GeckoProcessType_Default); diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index e5c8f334fa6..5c2ae2bb57e 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -188,7 +188,7 @@ ContentClientRemoteBuffer::BuildDeprecatedTextureClients(ContentType aType, if (!CreateAndAllocateDeprecatedTextureClient(mDeprecatedTextureClientOnWhite)) { return; } - mTextureInfo.mTextureFlags |= ComponentAlpha; + mTextureInfo.mTextureFlags |= TEXTURE_COMPONENT_ALPHA; } CreateFrontBufferAndNotify(aRect); @@ -305,7 +305,7 @@ ContentClientDoubleBuffered::CreateFrontBufferAndNotify(const nsIntRect& aBuffer return; } - if (mTextureInfo.mTextureFlags & ComponentAlpha) { + if (mTextureInfo.mTextureFlags & TEXTURE_COMPONENT_ALPHA) { if (!CreateAndAllocateDeprecatedTextureClient(mFrontClientOnWhite)) { return; } @@ -614,7 +614,7 @@ ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer, canReuseBuffer = neededRegion.GetBounds().Size() <= mBufferRect.Size() && mHasBuffer && (!(aFlags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE) || - !(mTextureInfo.mTextureFlags & AllowRepeat)); + !(mTextureInfo.mTextureFlags & TEXTURE_ALLOW_REPEAT)); if (canReuseBuffer) { if (mBufferRect.Contains(neededRegion.GetBounds())) { @@ -700,9 +700,9 @@ ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer, nsIntRect drawBounds = result.mRegionToDraw.GetBounds(); bool createdBuffer = false; - uint32_t bufferFlags = canHaveRotation ? AllowRepeat : 0; + uint32_t bufferFlags = canHaveRotation ? TEXTURE_ALLOW_REPEAT : 0; if (mode == Layer::SURFACE_COMPONENT_ALPHA) { - bufferFlags |= ComponentAlpha; + bufferFlags |= TEXTURE_COMPONENT_ALPHA; } if (canReuseBuffer) { nsIntRect keepArea; diff --git a/gfx/layers/composite/ContentHost.cpp b/gfx/layers/composite/ContentHost.cpp index 7ac5172cbe4..42692f16033 100644 --- a/gfx/layers/composite/ContentHost.cpp +++ b/gfx/layers/composite/ContentHost.cpp @@ -510,7 +510,7 @@ ContentHostIncremental::TextureCreationRequest::Execute(ContentHostIncremental* newHost->SetCompositor(compositor); } RefPtr newHostOnWhite; - if (mTextureInfo.mTextureFlags & ComponentAlpha) { + if (mTextureInfo.mTextureFlags & TEXTURE_COMPONENT_ALPHA) { newHostOnWhite = DeprecatedTextureHost::CreateDeprecatedTextureHost(SurfaceDescriptor::TShmem, mTextureInfo.mDeprecatedTextureHostFlags, diff --git a/gfx/layers/composite/ImageHost.cpp b/gfx/layers/composite/ImageHost.cpp index e8702079e5f..610616566ca 100644 --- a/gfx/layers/composite/ImageHost.cpp +++ b/gfx/layers/composite/ImageHost.cpp @@ -117,7 +117,7 @@ ImageHost::Composite(EffectChain& aEffectChain, rect = gfx::Rect(0, 0, textureSize.width, textureSize.height); } - if (mFrontBuffer->GetFlags() & NeedsYFlip) { + if (mFrontBuffer->GetFlags() & TEXTURE_NEEDS_Y_FLIP) { effect->mTextureCoords.y = effect->mTextureCoords.YMost(); effect->mTextureCoords.height = -effect->mTextureCoords.height; } @@ -298,7 +298,7 @@ DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain, rect = gfx::Rect(0, 0, textureSize.width, textureSize.height); } - if (mDeprecatedTextureHost->GetFlags() & NeedsYFlip) { + if (mDeprecatedTextureHost->GetFlags() & TEXTURE_NEEDS_Y_FLIP) { effect->mTextureCoords.y = effect->mTextureCoords.YMost(); effect->mTextureCoords.height = -effect->mTextureCoords.height; } diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp index 1fb4f311e04..7f569ea03a8 100644 --- a/gfx/layers/composite/TiledContentHost.cpp +++ b/gfx/layers/composite/TiledContentHost.cpp @@ -304,7 +304,7 @@ TiledTexture::Validate(gfxReusableSurfaceWrapper* aReusableSurface, Compositor* TEXTURE_HOST_TILED, flags); mDeprecatedTextureHost->SetCompositor(aCompositor); - flags |= NewTile; + flags |= TEXTURE_NEW_TILE; } mDeprecatedTextureHost->Update(aReusableSurface, flags, gfx::IntSize(aSize, aSize)); diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 2c5b7593b6c..af4765ed05d 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -110,9 +110,9 @@ FlagsToGLFlags(TextureFlags aFlags) { uint32_t result = TextureImage::NoFlags; - if (aFlags & UseNearestFilter) + if (aFlags & TEXTURE_USE_NEAREST_FILTER) result |= TextureImage::UseNearestFilter; - if (aFlags & NeedsYFlip) + if (aFlags & TEXTURE_NEEDS_Y_FLIP) result |= TextureImage::NeedsYFlip; if (aFlags & TEXTURE_DISALLOW_BIGIMAGE) result |= TextureImage::DisallowBigImage; @@ -154,13 +154,13 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface, // the size of aSurface. mTexImage = mGL->CreateTextureImage(size, gfx::ContentForFormat(aSurface->GetFormat()), - WrapMode(mGL, aFlags & AllowRepeat), + WrapMode(mGL, aFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(aFlags)); } else { mTexImage = CreateBasicTextureImage(mGL, size, gfx::ContentForFormat(aSurface->GetFormat()), - WrapMode(mGL, aFlags & AllowRepeat), + WrapMode(mGL, aFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(aFlags)); } } @@ -392,7 +392,7 @@ TextureImageDeprecatedTextureHostOGL::EnsureBuffer(const nsIntSize& aSize, mTexture->GetContentType() != aContentType) { mTexture = mGL->CreateTextureImage(aSize, aContentType, - WrapMode(mGL, mFlags & AllowRepeat), + WrapMode(mGL, mFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(mFlags)); } mTexture->Resize(aSize); @@ -430,7 +430,7 @@ TextureImageDeprecatedTextureHostOGL::UpdateImpl(const SurfaceDescriptor& aImage mTexture->GetContentType() != surf.ContentType()) { mTexture = mGL->CreateTextureImage(size, surf.ContentType(), - WrapMode(mGL, mFlags & AllowRepeat), + WrapMode(mGL, mFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(mFlags)); } @@ -513,7 +513,7 @@ SharedDeprecatedTextureHostOGL::SwapTexturesImpl(const SurfaceDescriptor& aImage nsIntSize size = texture.size(); mSize = gfx::IntSize(size.width, size.height); if (texture.inverted()) { - mFlags |= NeedsYFlip; + mFlags |= TEXTURE_NEEDS_Y_FLIP; } if (mSharedHandle && mSharedHandle != newHandle) { @@ -738,21 +738,21 @@ YCbCrDeprecatedTextureHostOGL::UpdateImpl(const SurfaceDescriptor& aImage, mYTexture->mTexImage = CreateBasicTextureImage(mGL, gfxSize, gfxASurface::CONTENT_ALPHA, - WrapMode(mGL, mFlags & AllowRepeat), + WrapMode(mGL, mFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(mFlags)); } if (!mCbTexture->mTexImage || mCbTexture->mTexImage->GetSize() != gfxCbCrSize) { mCbTexture->mTexImage = CreateBasicTextureImage(mGL, gfxCbCrSize, gfxASurface::CONTENT_ALPHA, - WrapMode(mGL, mFlags & AllowRepeat), + WrapMode(mGL, mFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(mFlags)); } if (!mCrTexture->mTexImage || mCrTexture->mTexImage->GetSize() != gfxCbCrSize) { mCrTexture->mTexImage = CreateBasicTextureImage(mGL, gfxCbCrSize, gfxASurface::CONTENT_ALPHA, - WrapMode(mGL, mFlags & AllowRepeat), + WrapMode(mGL, mFlags & TEXTURE_ALLOW_REPEAT), FlagsToGLFlags(mFlags)); } @@ -828,7 +828,7 @@ TiledDeprecatedTextureHostOGL::Update(gfxReusableSurfaceWrapper* aReusableSurfac { mSize = aSize; mGL->MakeCurrent(); - if (aFlags & NewTile) { + if (aFlags & TEXTURE_NEW_TILE) { SetFlags(aFlags); mGL->fGenTextures(1, &mTextureHandle); mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mTextureHandle); @@ -1107,7 +1107,7 @@ GrallocDeprecatedTextureHostOGL::GetRenderState() { if (mGraphicBuffer.get()) { - uint32_t flags = mFlags & NeedsYFlip ? LAYER_RENDER_STATE_Y_FLIPPED : 0; + uint32_t flags = mFlags & TEXTURE_NEEDS_Y_FLIP ? LAYER_RENDER_STATE_Y_FLIPPED : 0; /* * The 32 bit format of gralloc buffer is created as RGBA8888 or RGBX888 by default.