Skip to content

Commit

Permalink
Bug 552020. Part 2. Enable Vsync Profiler Markers across platforms. r…
Browse files Browse the repository at this point in the history
…=benwa
  • Loading branch information
Mason Chang committed Nov 14, 2014
1 parent ee275a7 commit 4fddbd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gfx/layers/ipc/CompositorParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ InsertVsyncProfilerMarker(TimeStamp aVsyncTimestamp)
/*static */ void
CompositorParent::PostInsertVsyncProfilerMarker(TimeStamp aVsyncTimestamp)
{
if (profiler_is_active()) {
if (profiler_is_active() && sCompositorThreadHolder) {
CompositorLoop()->PostTask(FROM_HERE,
NewRunnableFunction(InsertVsyncProfilerMarker, aVsyncTimestamp));
}
Expand Down
11 changes: 11 additions & 0 deletions widget/VsyncDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
#include "mozilla/layers/CompositorParent.h"
#include "gfxPrefs.h"

#ifdef MOZ_ENABLE_PROFILER_SPS
#include "GeckoProfiler.h"
#include "ProfilerMarkers.h"
#endif

#ifdef MOZ_WIDGET_GONK
#include "GeckoTouchDispatcher.h"
#endif
Expand Down Expand Up @@ -63,6 +68,12 @@ void
VsyncDispatcher::NotifyVsync(TimeStamp aVsyncTimestamp)
{
bool notifiedCompositors = false;
#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_is_active()) {
CompositorParent::PostInsertVsyncProfilerMarker(aVsyncTimestamp);
}
#endif

if (gfxPrefs::VsyncAlignedCompositor()) {
MutexAutoLock lock(mCompositorObserverLock);
notifiedCompositors = NotifyVsyncObservers(aVsyncTimestamp, mCompositorObservers);
Expand Down
13 changes: 0 additions & 13 deletions widget/gonk/HwcComposer2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#include "mozilla/StaticPtr.h"
#include "cutils/properties.h"
#include "gfx2DGlue.h"
#include "GeckoTouchDispatcher.h"

#ifdef MOZ_ENABLE_PROFILER_SPS
#include "GeckoProfiler.h"
#include "ProfilerMarkers.h"
#endif

#if ANDROID_VERSION >= 17
#include "libdisplay/FramebufferSurface.h"
Expand Down Expand Up @@ -243,13 +237,6 @@ HwcComposer2D::Vsync(int aDisplay, nsecs_t aVsyncTimestamp)
LOGE("Non-uniform vsync interval: %lld\n", vsyncInterval);
}
mLastVsyncTime = aVsyncTimestamp;

#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_is_active()) {
CompositorParent::PostInsertVsyncProfilerMarker(vsyncTime);
}
#endif

VsyncDispatcher::GetInstance()->NotifyVsync(vsyncTime);
}

Expand Down

0 comments on commit 4fddbd3

Please sign in to comment.