Bug 1057222 - Avoid uploading the whole tile when it's new but only partially valid. r=BenWa

--HG--
extra : rebase_source : 8fe73f903f2917830f05fd82a865a5376ecab31c
This commit is contained in:
Matt Woodrow 2014-08-27 18:52:24 +12:00
parent 7b1157f5a9
commit 8b5e9e6b2d

View File

@ -310,6 +310,16 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
SurfaceFormatToImageFormat(aSurface->GetFormat()));
}
ClearCachedFilter();
if (aDestRegion &&
!aSrcOffset &&
!aDestRegion->IsEqual(nsIntRect(0, 0, size.width, size.height))) {
// UpdateFromDataSource will ignore our specified aDestRegion since the texture
// hasn't been allocated with glTexImage2D yet. Call Resize() to force the
// allocation (full size, but no upload), and then we'll only upload the pixels
// we care about below.
mTexImage->Resize(size);
}
}
mTexImage->UpdateFromDataSource(aSurface, aDestRegion, aSrcOffset);