Bug 1016437 - Document why we don't use TiledTextureImage for YCbCr frames and add an assert to that effect. r=nical

This commit is contained in:
Markus Stange 2014-05-28 12:52:12 +02:00
parent 97aa604da3
commit 922651b231
2 changed files with 20 additions and 3 deletions

View File

@ -106,11 +106,25 @@ ImageHost::Composite(EffectChain& aEffectChain,
gfx::Rect pictureRect(0, 0,
mPictureRect.width,
mPictureRect.height);
//XXX: We might have multiple texture sources here (e.g. 3 YCbCr textures), and we're
// only iterating over the tiles of the first one. Are we assuming that the tiling
// will be identical? Can we ensure that somehow?
BigImageIterator* it = source->AsBigImageIterator();
if (it) {
// This iteration does not work if we have multiple texture sources here
// (e.g. 3 YCbCr textures). There's nothing preventing the different
// planes from having different resolutions or tile sizes. For example, a
// YCbCr frame could have Cb and Cr planes that are half the resolution of
// the Y plane, in such a way that the Y plane overflows the maximum
// texture size and the Cb and Cr planes do not. Then the Y plane would be
// split into multiple tiles and the Cb and Cr planes would just be one
// tile each.
// To handle the general case correctly, we'd have to create a grid of
// intersected tiles over all planes, and then draw each grid tile using
// the corresponding source tiles from all planes, with appropriate
// per-plane per-tile texture coords.
// DrawQuad currently assumes that all planes use the same texture coords.
MOZ_ASSERT(it->GetTileCount() == 1 || !source->GetNextSibling(),
"Can't handle multi-plane BigImages");
it->BeginBigImageIteration();
do {
nsIntRect tileRect = it->GetTileRect();

View File

@ -251,6 +251,9 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
(mTexImage->GetSize() != size && !aSrcOffset) ||
mTexImage->GetContentType() != gfx::ContentForFormat(aSurface->GetFormat())) {
if (mFlags & TextureFlags::DISALLOW_BIGIMAGE) {
// Explicitly use CreateBasicTextureImage instead of CreateTextureImage,
// because CreateTextureImage may still create a tiled texture image
// if the maximum texture size is exceeded.
mTexImage = CreateBasicTextureImage(mGL, size,
gfx::ContentForFormat(aSurface->GetFormat()),
WrapMode(mGL, mFlags),