mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
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:
parent
7b1157f5a9
commit
8b5e9e6b2d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user