Bug 854446: Allow setting Moz2D recording destination. r=joedrew
authorBas Schouten <bschouten@mozilla.com>
Tue, 26 Mar 2013 03:20:30 +0000
changeset 136598 22f4559c2f00d827aa0fa47db2b763fb3e388018
parent 136597 fde2b7379adaf14d97655a2a63ca33f6a454fb94
child 136599 2e93bd9434821258b69164c567b6e8222b861bdb
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-beta@d4b152d29d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoedrew
bugs854446
milestone22.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 854446: Allow setting Moz2D recording destination. r=joedrew
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -374,17 +374,27 @@ gfxPlatform::Init()
 #endif
 
     // Force registration of the gfx component, thus arranging for
     // ::Shutdown to be called.
     nsCOMPtr<nsISupports> forceReg
         = do_CreateInstance("@mozilla.org/gfx/init;1");
 
     if (Preferences::GetBool("gfx.2d.recording", false)) {
-      gPlatform->mRecorder = Factory::CreateEventRecorderForFile("browserrecording.aer");
+
+      nsAutoCString fileName;
+      nsAdoptingString prefFileName = Preferences::GetString("gfx.2d.recordingfile");
+
+      if (prefFileName) {
+        fileName.Append(NS_ConvertUTF16toUTF8(prefFileName));
+      } else {
+        fileName.AssignLiteral("browserrecording.aer");
+      }
+
+      gPlatform->mRecorder = Factory::CreateEventRecorderForFile(fileName.BeginReading());
       Factory::SetGlobalEventRecorder(gPlatform->mRecorder);
     }
 
     gPlatform->mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
 
     CreateCMSOutputProfile();
 }