mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 935701 - Get drawing recording working on b2g. r=bas
--HG-- extra : rebase_source : 783627519f291d187552b464689315ce2697df95
This commit is contained in:
parent
e5e85044a9
commit
5788c09304
@ -214,7 +214,10 @@ void RecordingFontUserDataDestroyFunc(void *aUserData)
|
||||
RecordingFontUserData *userData =
|
||||
static_cast<RecordingFontUserData*>(aUserData);
|
||||
|
||||
// TODO support font in b2g recordings
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
userData->recorder->RecordEvent(RecordedScaledFontDestruction(userData->refPtr));
|
||||
#endif
|
||||
|
||||
delete userData;
|
||||
}
|
||||
@ -227,7 +230,10 @@ DrawTargetRecording::FillGlyphs(ScaledFont *aFont,
|
||||
const GlyphRenderingOptions *aRenderingOptions)
|
||||
{
|
||||
if (!aFont->GetUserData(reinterpret_cast<UserDataKey*>(mRecorder.get()))) {
|
||||
// TODO support font in b2g recordings
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
mRecorder->RecordEvent(RecordedScaledFontCreation(aFont, aFont));
|
||||
#endif
|
||||
RecordingFontUserData *userData = new RecordingFontUserData;
|
||||
userData->refPtr = aFont;
|
||||
userData->recorder = mRecorder;
|
||||
@ -235,7 +241,10 @@ DrawTargetRecording::FillGlyphs(ScaledFont *aFont,
|
||||
&RecordingFontUserDataDestroyFunc);
|
||||
}
|
||||
|
||||
// TODO support font in b2g recordings
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
mRecorder->RecordEvent(RecordedFillGlyphs(this, aFont, aPattern, aOptions, aBuffer.mGlyphs, aBuffer.mNumGlyphs));
|
||||
#endif
|
||||
mFinalDT->FillGlyphs(aFont, aBuffer, aPattern, aOptions, aRenderingOptions);
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
#include "gfxWindowsPlatform.h"
|
||||
@ -319,10 +321,23 @@ int RecordingPrefChanged(const char *aPrefName, void *aClosure)
|
||||
if (prefFileName) {
|
||||
fileName.Append(NS_ConvertUTF16toUTF8(prefFileName));
|
||||
} else {
|
||||
fileName.AssignLiteral("browserrecording.aer");
|
||||
nsCOMPtr<nsIFile> tmpFile;
|
||||
if (NS_FAILED(NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpFile)))) {
|
||||
return 0;
|
||||
}
|
||||
fileName.AppendPrintf("moz2drec_%i_%i.aer", XRE_GetProcessType(), getpid());
|
||||
|
||||
nsresult rv = tmpFile->AppendNative(fileName);
|
||||
if (NS_FAILED(rv))
|
||||
return 0;
|
||||
|
||||
rv = tmpFile->GetNativePath(fileName);
|
||||
if (NS_FAILED(rv))
|
||||
return 0;
|
||||
}
|
||||
|
||||
gPlatform->mRecorder = Factory::CreateEventRecorderForFile(fileName.BeginReading());
|
||||
printf_stderr("Recording to %s\n", fileName.get());
|
||||
Factory::SetGlobalEventRecorder(gPlatform->mRecorder);
|
||||
} else {
|
||||
Factory::SetGlobalEventRecorder(nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user