Bug 705559. Part 4: Speed up AddDependencyOnSource by exiting early when we already have the dependency. r=bas
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 09 Dec 2011 22:53:14 +1300
changeset 84015 40a13154e0bab8ef4ba38382c58c7ef35846f236
parent 84014 c635867cc091b0c3b81e9cb0c4e6594791b22688
child 84016 e76f06f7e08dd32d654cc0077c41b065b58d59a1
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs705559
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 705559. Part 4: Speed up AddDependencyOnSource by exiting early when we already have the dependency. r=bas
gfx/2d/DrawTargetD2D.cpp
--- a/gfx/2d/DrawTargetD2D.cpp
+++ b/gfx/2d/DrawTargetD2D.cpp
@@ -244,17 +244,17 @@ DrawTargetD2D::Flush()
     (*iter)->mDependentTargets.erase(this);
   }
   mDependingOnTargets.clear();
 }
 
 void
 DrawTargetD2D::AddDependencyOnSource(SourceSurfaceD2DTarget* aSource)
 {
-  if (aSource->mDrawTarget) {
+  if (aSource->mDrawTarget && !mDependingOnTargets.count(aSource->mDrawTarget)) {
     aSource->mDrawTarget->mDependentTargets.insert(this);
     mDependingOnTargets.insert(aSource->mDrawTarget);
   }
 }
 
 void
 DrawTargetD2D::DrawSurface(SourceSurface *aSurface,
                            const Rect &aDest,