Bug 1265824 - Don't recycle the texture source if it's direct mapping r?mstange
There is no benefit to recycling the old one. That will have an additional
memory copy from the new texture host to the old texture source. We should
just wrap the new texture host to a direct mapping texture source to get
better texture uploading performance.
MozReview-Commit-ID: 9ONQAhvKmuh
--- a/gfx/layers/composite/TiledContentHost.cpp
+++ b/gfx/layers/composite/TiledContentHost.cpp
@@ -233,17 +233,17 @@ public:
}
}
}
// Attempts to recycle any texture source to avoid needing to allocate
// a new one.
void RecycleTextureSource(TileHost& aTile) {
for (size_t i = mFirstPossibility; i < mTiles.Length(); i++) {
- if (!mTiles[i].mTextureSource) {
+ if (!mTiles[i].mTextureSource || mTiles[i].mTextureSource->IsDirectMap()) {
if (i == mFirstPossibility) {
mFirstPossibility++;
}
continue;
}
if (mTiles[i].mTextureSource &&
mTiles[i].mTextureHost->GetFormat() == aTile.mTextureHost->GetFormat()) {