Backed out changesets b57d930e0ba6 and 6c8a74ba8122 (bug 1129871) for gtest failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-02-05 13:12:18 -05:00
Родитель bf97c2533d
Коммит 79bed2d741
5 изменённых файлов: 43 добавлений и 33 удалений

Просмотреть файл

@ -516,7 +516,7 @@ TiledLayerBuffer<Derived, Tile>::Update(const nsIntRegion& aNewValidRegion,
static_cast<unsigned>(index) < newRetainedTiles.Length(),
"index out of range");
Tile& newTile = newRetainedTiles[index];
Tile newTile = newRetainedTiles[index];
// Try to reuse a tile from the old retained tiles that had no partially
// valid content.
@ -532,12 +532,13 @@ TiledLayerBuffer<Derived, Tile>::Update(const nsIntRegion& aNewValidRegion,
// in which case it's up to the derived class's ValidateTile()
// implementation to allocate a new tile before drawing
nsIntPoint tileOrigin(tileStartX, tileStartY);
AsDerived().ValidateTile(newTile, nsIntPoint(tileStartX, tileStartY),
tileDrawRegion);
newTile = AsDerived().ValidateTile(newTile, nsIntPoint(tileStartX, tileStartY),
tileDrawRegion);
NS_ASSERTION(!IsPlaceholder(newTile), "Unexpected placeholder tile - failed to allocate?");
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
printf_stderr("Store Validate tile %i, %i -> %i\n", tileStartX, tileStartY, index);
#endif
newRetainedTiles[index] = newTile;
y += height;
}

Просмотреть файл

@ -1086,7 +1086,7 @@ ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion)
}
void
ClientTiledLayerBuffer::UnlockTile(TileClient& aTile)
ClientTiledLayerBuffer::UnlockTile(TileClient aTile)
{
// We locked the back buffer, and flipped so we now need to unlock the front
if (aTile.mFrontBuffer && aTile.mFrontBuffer->IsLocked()) {
@ -1105,8 +1105,8 @@ ClientTiledLayerBuffer::UnlockTile(TileClient& aTile)
}
}
void
ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
TileClient
ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
const nsIntPoint& aTileOrigin,
const nsIntRegion& aDirtyRegion)
{
@ -1147,24 +1147,27 @@ ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
if (!backBuffer) {
NS_WARNING("Failed to allocate a tile TextureClient");
aTile.Release();
return;
aTile.DiscardBackBuffer();
aTile.DiscardFrontBuffer();
return TileClient();
}
// the back buffer may have been already locked in ValidateBackBufferFromFront
if (!backBuffer->IsLocked()) {
if (!backBuffer->Lock(OpenMode::OPEN_READ_WRITE)) {
NS_WARNING("Failed to lock a tile TextureClient");
aTile.Release();
return;
aTile.DiscardBackBuffer();
aTile.DiscardFrontBuffer();
return TileClient();
}
}
if (backBufferOnWhite && !backBufferOnWhite->IsLocked()) {
if (!backBufferOnWhite->Lock(OpenMode::OPEN_READ_WRITE)) {
NS_WARNING("Failed to lock tile TextureClient for updating.");
aTile.Release();
return;
aTile.DiscardBackBuffer();
aTile.DiscardFrontBuffer();
return TileClient();
}
}
@ -1174,13 +1177,15 @@ ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
if (createdTextureClient) {
if (!mCompositableClient->AddTextureClient(backBuffer)) {
NS_WARNING("Failed to add tile TextureClient.");
aTile.Release();
return;
aTile.DiscardFrontBuffer();
aTile.DiscardBackBuffer();
return aTile;
}
if (backBufferOnWhite && !mCompositableClient->AddTextureClient(backBufferOnWhite)) {
NS_WARNING("Failed to add tile TextureClient.");
aTile.Release();
return;
aTile.DiscardFrontBuffer();
aTile.DiscardBackBuffer();
return aTile;
}
}
@ -1196,9 +1201,9 @@ ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
}
moz2DTile.mTileOrigin = gfx::IntPoint(aTileOrigin.x, aTileOrigin.y);
if (!dt || (backBufferOnWhite && !dtOnWhite)) {
NS_WARNING("Failed to get a DrawTarget from a tile");
aTile.Release();
return;
aTile.DiscardFrontBuffer();
aTile.DiscardBackBuffer();
return aTile;
}
mMoz2DTiles.push_back(moz2DTile);
@ -1231,7 +1236,7 @@ ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
aTile.Flip();
return;
return aTile;
}
// Single paint buffer case:
@ -1294,8 +1299,9 @@ ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
if (createdTextureClient) {
if (!mCompositableClient->AddTextureClient(backBuffer)) {
NS_WARNING("Failed to add tile TextureClient.");
aTile.Release();
return;
aTile.DiscardFrontBuffer();
aTile.DiscardBackBuffer();
return aTile;
}
}
@ -1309,6 +1315,8 @@ ClientTiledLayerBuffer::ValidateTile(TileClient& aTile,
// TextureClient around unnecessarily, so discard the back-buffer.
aTile.DiscardBackBuffer();
}
return aTile;
}
/**

Просмотреть файл

@ -442,15 +442,15 @@ public:
SurfaceDescriptorTiles GetSurfaceDescriptorTiles();
protected:
void ValidateTile(TileClient& aTile,
const nsIntPoint& aTileRect,
const nsIntRegion& dirtyRect);
TileClient ValidateTile(TileClient aTile,
const nsIntPoint& aTileRect,
const nsIntRegion& dirtyRect);
void PostValidate(const nsIntRegion& aPaintRegion);
void UnlockTile(TileClient& aTile);
void UnlockTile(TileClient aTile);
void ReleaseTile(TileClient& aTile) { aTile.Release(); }
void ReleaseTile(TileClient aTile) { aTile.Release(); }
void SwapTiles(TileClient& aTileA, TileClient& aTileB) { std::swap(aTileA, aTileB); }

Просмотреть файл

@ -168,14 +168,14 @@ TiledLayerBufferComposite::Upload()
ClearPaintedRegion();
}
void
TiledLayerBufferComposite::ValidateTile(TileHost& aTile,
TileHost
TiledLayerBufferComposite::ValidateTile(TileHost aTile,
const nsIntPoint& aTileOrigin,
const nsIntRegion& aDirtyRect)
{
if (aTile.IsPlaceholderTile()) {
NS_WARNING("Placeholder tile encountered in painted region");
return;
return aTile;
}
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
@ -205,6 +205,7 @@ TiledLayerBufferComposite::ValidateTile(TileHost& aTile,
printf_stderr("Tile Time to upload %i\n", PR_IntervalNow() - start);
}
#endif
return aTile;
}
void

Просмотреть файл

@ -164,9 +164,9 @@ public:
static void RecycleCallback(TextureHost* textureHost, void* aClosure);
protected:
void ValidateTile(TileHost& aTile,
const nsIntPoint& aTileRect,
const nsIntRegion& dirtyRect);
TileHost ValidateTile(TileHost aTile,
const nsIntPoint& aTileRect,
const nsIntRegion& dirtyRect);
// do nothing, the desctructor in the texture host takes care of releasing resources
void ReleaseTile(TileHost aTile) {}