diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index 7081b9986cb1..e1d4b32fc183 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -221,7 +221,7 @@ TiledTextureImage::TiledTextureImage(GLContext* aGL, , mGL(aGL) , mTextureState(Created) { - if (!(aFlags & TextureImage::ForceSingleTile) && mGL->WantsSmallTiles()) { + if (!(aFlags & TextureImage::DisallowBigImage) && mGL->WantsSmallTiles()) { mTileSize = 256; } else { mGL->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, (GLint*) &mTileSize); diff --git a/gfx/gl/GLTextureImage.h b/gfx/gl/GLTextureImage.h index 0122089eca1c..229294d91711 100644 --- a/gfx/gl/GLTextureImage.h +++ b/gfx/gl/GLTextureImage.h @@ -57,7 +57,7 @@ public: NoFlags = 0x0, UseNearestFilter = 0x1, NeedsYFlip = 0x2, - ForceSingleTile = 0x4 + DisallowBigImage = 0x4 }; typedef gfxASurface::gfxContentType ContentType; diff --git a/gfx/layers/CompositorTypes.h b/gfx/layers/CompositorTypes.h index 379f4f481e68..f2219be158be 100644 --- a/gfx/layers/CompositorTypes.h +++ b/gfx/layers/CompositorTypes.h @@ -29,7 +29,7 @@ const TextureFlags UseNearestFilter = 1 << 0; const TextureFlags NeedsYFlip = 1 << 1; // Force the texture to be represented using a single tile (note that this means // tiled textures, not tiled layers). -const TextureFlags ForceSingleTile = 1 << 2; +const TextureFlags TEXTURE_DISALLOW_BIGIMAGE = 1 << 2; // Allow using 'repeat' mode for wrapping. const TextureFlags AllowRepeat = 1 << 3; // The texture represents a tile which is newly created. diff --git a/gfx/layers/ImageLayers.cpp b/gfx/layers/ImageLayers.cpp index eb7b1c9c53e2..a195f1d07bbb 100644 --- a/gfx/layers/ImageLayers.cpp +++ b/gfx/layers/ImageLayers.cpp @@ -11,7 +11,7 @@ namespace layers { ImageLayer::ImageLayer(LayerManager* aManager, void* aImplData) : Layer(aManager, aImplData), mFilter(gfxPattern::FILTER_GOOD) -, mScaleMode(SCALE_NONE), mForceSingleTile(false) +, mScaleMode(SCALE_NONE), mDisallowBigImage(false) {} ImageLayer::~ImageLayer() diff --git a/gfx/layers/ImageLayers.h b/gfx/layers/ImageLayers.h index 4ae2ca01a67f..5433336d3b69 100644 --- a/gfx/layers/ImageLayers.h +++ b/gfx/layers/ImageLayers.h @@ -75,11 +75,11 @@ public: /** * if true, the image will only be backed by a single tile texture */ - void SetForceSingleTile(bool aForceSingleTile) + void SetDisallowBigImage(bool aDisallowBigImage) { - if (mForceSingleTile != aForceSingleTile) { - MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ForceSingleTile", this)); - mForceSingleTile = aForceSingleTile; + if (mDisallowBigImage != aDisallowBigImage) { + MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) DisallowBigImage", this)); + mDisallowBigImage = aDisallowBigImage; Mutated(); } } @@ -94,7 +94,7 @@ protected: gfxPattern::GraphicsFilter mFilter; gfxIntSize mScaleToSize; ScaleMode mScaleMode; - bool mForceSingleTile; + bool mDisallowBigImage; }; } diff --git a/gfx/layers/LayersLogging.cpp b/gfx/layers/LayersLogging.cpp index c190e5b7e72f..45d52d0a6e5a 100644 --- a/gfx/layers/LayersLogging.cpp +++ b/gfx/layers/LayersLogging.cpp @@ -212,7 +212,7 @@ AppendToString(nsACString& s, TextureFlags flags, bool previous = false; AppendFlag(UseNearestFilter); AppendFlag(NeedsYFlip); - AppendFlag(ForceSingleTile); + AppendFlag(TEXTURE_DISALLOW_BIGIMAGE); AppendFlag(AllowRepeat); AppendFlag(NewTile); AppendFlag(TEXTURE_DEALLOCATE_HOST); diff --git a/gfx/layers/client/ClientImageLayer.cpp b/gfx/layers/client/ClientImageLayer.cpp index 7425adaebd32..b21d1d4afd50 100644 --- a/gfx/layers/client/ClientImageLayer.cpp +++ b/gfx/layers/client/ClientImageLayer.cpp @@ -127,8 +127,8 @@ ClientImageLayer::RenderLayer() } mImageClient = ImageClient::CreateImageClient(type, ClientManager(), - mForceSingleTile - ? ForceSingleTile + mDisallowBigImage + ? TEXTURE_DISALLOW_BIGIMAGE : 0); if (type == BUFFER_BRIDGE) { static_cast(mImageClient.get())->SetLayer(this); diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index b48aa8dd5812..5ceec5473a5d 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -316,9 +316,10 @@ BufferTextureHost::Upload(nsIntRegion *aRegion) RefPtr srcU; RefPtr srcV; if (!mFirstSource) { - srcY = mCompositor->CreateDataTextureSource(mFlags); - srcU = mCompositor->CreateDataTextureSource(mFlags); - srcV = mCompositor->CreateDataTextureSource(mFlags); + // We don't support BigImages for YCbCr compositing. + srcY = mCompositor->CreateDataTextureSource(mFlags|TEXTURE_DISALLOW_BIGIMAGE); + srcU = mCompositor->CreateDataTextureSource(mFlags|TEXTURE_DISALLOW_BIGIMAGE); + srcV = mCompositor->CreateDataTextureSource(mFlags|TEXTURE_DISALLOW_BIGIMAGE); mFirstSource = srcY; srcY->SetNextSibling(srcU); srcU->SetNextSibling(srcV); diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index 6ba9a80a94b3..ce57660f199c 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -1415,7 +1415,8 @@ TemporaryRef CompositorOGL::CreateDataTextureSource(TextureFlags aFlags) { RefPtr result = - new TextureImageTextureSourceOGL(mGLContext, !(aFlags & ForceSingleTile)); + new TextureImageTextureSourceOGL(mGLContext, + !(aFlags & TEXTURE_DISALLOW_BIGIMAGE)); return result; } diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 8b700f192077..61703eb4c757 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -114,8 +114,8 @@ FlagsToGLFlags(TextureFlags aFlags) result |= TextureImage::UseNearestFilter; if (aFlags & NeedsYFlip) result |= TextureImage::NeedsYFlip; - if (aFlags & ForceSingleTile) - result |= TextureImage::ForceSingleTile; + if (aFlags & TEXTURE_DISALLOW_BIGIMAGE) + result |= TextureImage::DisallowBigImage; return static_cast(result); } @@ -148,7 +148,7 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface, if (!mTexImage || mTexImage->GetSize() != size || mTexImage->GetContentType() != gfx::ContentForFormat(aSurface->GetFormat())) { - if (mAllowTiling) { + if (mAllowBigImage) { // XXX - clarify the which size we want to use. Some use cases may // require the size of the destnation surface to be different from // the size of aSurface. diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index fec923356e9a..865c10aa01d3 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -105,9 +105,9 @@ class TextureImageTextureSourceOGL : public DataTextureSource , public TileIterator { public: - TextureImageTextureSourceOGL(gl::GLContext* aGL, bool aAllowTiling = true) + TextureImageTextureSourceOGL(gl::GLContext* aGL, bool aAllowBiImage = true) : mGL(aGL) - , mAllowTiling(aAllowTiling) + , mAllowBigImage(aAllowBiImage) , mIterating(false) {} @@ -179,7 +179,7 @@ public: protected: nsRefPtr mTexImage; gl::GLContext* mGL; - bool mAllowTiling; + bool mAllowBigImage; bool mIterating; }; diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 6dac6c349386..72f2750f410d 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -1230,7 +1230,7 @@ ContainerState::CreateOrRecycleMaskImageLayerFor(Layer* aLayer) if (!result) return nullptr; result->SetUserData(&gMaskLayerUserData, new MaskLayerUserData()); - result->SetForceSingleTile(true); + result->SetDisallowBigImage(true); } return result.forget();