Bug 705559. Part 4: Speed up AddDependencyOnSource by exiting early when we already have the dependency. r=bas

This commit is contained in:
Robert O'Callahan 2011-12-09 22:53:14 +13:00
parent f7fb3da105
commit b6f282fb4f

View File

@ -249,7 +249,7 @@ DrawTargetD2D::Flush()
void
DrawTargetD2D::AddDependencyOnSource(SourceSurfaceD2DTarget* aSource)
{
if (aSource->mDrawTarget) {
if (aSource->mDrawTarget && !mDependingOnTargets.count(aSource->mDrawTarget)) {
aSource->mDrawTarget->mDependentTargets.insert(this);
mDependingOnTargets.insert(aSource->mDrawTarget);
}