Bug 1292747 (Part 3) - Clean up some comments in imgFrame related to Optimize()'s behavior. r=edwin
authorSeth Fowler <mark.seth.fowler@gmail.com>
Sat, 06 Aug 2016 01:42:36 -0700
changeset 350018 5fcf01a3984e4eed813a9975246acc71d64883f0
parent 350017 253ca6b47c8f5fd214101e48704470ae169c30f1
child 350019 65e98f10c1c753359312ea9d78ac602406065a0b
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1292747
milestone51.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 1292747 (Part 3) - Clean up some comments in imgFrame related to Optimize()'s behavior. r=edwin
image/imgFrame.cpp
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -781,21 +781,23 @@ imgFrame::UnlockImageData()
   if (mLockCount == 1 && !mPalettedImageData) {
     // We can't safely optimize off-main-thread, so create a runnable to do it.
     if (!NS_IsMainThread()) {
       nsCOMPtr<nsIRunnable> runnable = new UnlockImageDataRunnable(this);
       NS_DispatchToMainThread(runnable);
       return NS_OK;
     }
 
-    // Convert the data surface to a GPU surface or a single color if possible.
-    // This will also release mImageSurface if possible.
+    // Convert our data surface to a GPU surface if possible. We'll also try to
+    // release mImageSurface.
     Optimize();
 
-    // Allow the OS to release our data surface.
+    // Allow the OS to release our data surface. Note that mImageSurface also
+    // keeps our volatile buffer alive, so this doesn't actually work unless we
+    // released mImageSurface in Optimize().
     mVBufPtr = nullptr;
   }
 
   mLockCount--;
 
   return NS_OK;
 }