зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 73a60f9b3c2f (bug 1275314) for GTest bustage CLOSED TREE
--HG-- extra : histedit_source : 5498a231b3e43706e93835242d246489697dcd9c%2C1ba18b3300a0dfd8b03881bf431334be1f866eb8
This commit is contained in:
Родитель
727d0de706
Коммит
aeac5ac648
|
@ -45,14 +45,4 @@ interface CheckerboardReportService {
|
|||
* Sets the state of the apz.record_checkerboarding pref.
|
||||
*/
|
||||
void setRecordingEnabled(boolean aEnabled);
|
||||
|
||||
/**
|
||||
* Flush any in-progress checkerboard reports. Since this happens
|
||||
* asynchronously, the caller may register an observer with the observer
|
||||
* service to be notified when this operation is complete. The observer should
|
||||
* listen for the topic "APZ:FlushActiveCheckerboard:Done". Upon receiving
|
||||
* this notification, the caller may call getReports() to obtain the flushed
|
||||
* reports, along with any other reports that are available.
|
||||
*/
|
||||
void flushActiveReports();
|
||||
};
|
||||
|
|
|
@ -123,17 +123,6 @@ GPUChild::RecvInitCrashReporter(Shmem&& aShmem)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GPUChild::RecvNotifyUiObservers(const nsCString& aTopic)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
MOZ_ASSERT(obsSvc);
|
||||
if (obsSvc) {
|
||||
obsSvc->NotifyObservers(nullptr, aTopic.get(), nullptr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
GPUChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,6 @@ public:
|
|||
bool RecvInitCrashReporter(Shmem&& shmem) override;
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
bool RecvGraphicsError(const nsCString& aError) override;
|
||||
bool RecvNotifyUiObservers(const nsCString& aTopic) override;
|
||||
|
||||
static void Destroy(UniquePtr<GPUChild>&& aChild);
|
||||
|
||||
|
|
|
@ -305,17 +305,6 @@ GPUParent::RecvAddLayerTreeIdMapping(const uint64_t& aLayersId, const ProcessId&
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GPUParent::RecvNotifyGpuObservers(const nsCString& aTopic)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
MOZ_ASSERT(obsSvc);
|
||||
if (obsSvc) {
|
||||
obsSvc->NotifyObservers(nullptr, aTopic.get(), nullptr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
GPUParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
|
|
|
@ -47,7 +47,6 @@ public:
|
|||
bool RecvDeallocateLayerTreeId(const uint64_t& aLayersId) override;
|
||||
bool RecvGetDeviceStatus(GPUDeviceData* aOutStatus) override;
|
||||
bool RecvAddLayerTreeIdMapping(const uint64_t& aLayersId, const ProcessId& aOwnerId) override;
|
||||
bool RecvNotifyGpuObservers(const nsCString& aTopic) override;
|
||||
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
|
|
|
@ -740,16 +740,5 @@ GPUProcessManager::RemoveListener(GPUProcessListener* aListener)
|
|||
mListeners.RemoveElement(aListener);
|
||||
}
|
||||
|
||||
bool
|
||||
GPUProcessManager::NotifyGpuObservers(const char* aTopic)
|
||||
{
|
||||
if (!mGPUChild) {
|
||||
return false;
|
||||
}
|
||||
nsCString topic(aTopic);
|
||||
mGPUChild->SendNotifyGpuObservers(topic);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -128,10 +128,6 @@ public:
|
|||
void AddListener(GPUProcessListener* aListener);
|
||||
void RemoveListener(GPUProcessListener* aListener);
|
||||
|
||||
// Send a message to the GPU process observer service to broadcast. Returns
|
||||
// true if the message was sent, false if not.
|
||||
bool NotifyGpuObservers(const char* aTopic);
|
||||
|
||||
// Returns access to the PGPU protocol if a GPU process is present.
|
||||
GPUChild* GetGPUChild() {
|
||||
return mGPUChild;
|
||||
|
|
|
@ -68,10 +68,6 @@ parent:
|
|||
// one is available (i.e., Init has completed).
|
||||
sync GetDeviceStatus() returns (GPUDeviceData status);
|
||||
|
||||
// Have a message be broadcasted to the GPU process by the GPU process
|
||||
// observer service.
|
||||
async NotifyGpuObservers(nsCString aTopic);
|
||||
|
||||
child:
|
||||
// Sent when the GPU process has initialized devices. This occurs once, after
|
||||
// Init().
|
||||
|
@ -84,10 +80,6 @@ child:
|
|||
async GraphicsError(nsCString aError);
|
||||
|
||||
async InitCrashReporter(Shmem shmem);
|
||||
|
||||
// Have a message be broadcasted to the UI process by the UI process
|
||||
// observer service.
|
||||
async NotifyUiObservers(nsCString aTopic);
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "InputData.h" // for InputData, etc
|
||||
#include "Layers.h" // for Layer, etc
|
||||
#include "mozilla/dom/Touch.h" // for Touch
|
||||
#include "mozilla/gfx/GPUParent.h" // for GPUParent
|
||||
#include "mozilla/gfx/Logging.h" // for gfx::TreeLog
|
||||
#include "mozilla/gfx/Point.h" // for Point
|
||||
#include "mozilla/layers/APZThreadUtils.h" // for AssertOnCompositorThread, etc
|
||||
|
@ -85,76 +84,6 @@ struct APZCTreeManager::TreeBuildingState {
|
|||
std::map<ScrollableLayerGuid, AsyncPanZoomController*> mApzcMap;
|
||||
};
|
||||
|
||||
class APZCTreeManager::CheckerboardFlushObserver : public nsIObserver {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
explicit CheckerboardFlushObserver(APZCTreeManager* aTreeManager)
|
||||
: mTreeManager(aTreeManager)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
MOZ_ASSERT(obsSvc);
|
||||
if (obsSvc) {
|
||||
obsSvc->AddObserver(this, "APZ:FlushActiveCheckerboard", false);
|
||||
}
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
obsSvc->RemoveObserver(this, "APZ:FlushActiveCheckerboard");
|
||||
}
|
||||
mTreeManager = nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~CheckerboardFlushObserver() {}
|
||||
|
||||
private:
|
||||
RefPtr<APZCTreeManager> mTreeManager;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(APZCTreeManager::CheckerboardFlushObserver, nsIObserver)
|
||||
|
||||
NS_IMETHODIMP
|
||||
APZCTreeManager::CheckerboardFlushObserver::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
const char16_t*)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(mTreeManager.get());
|
||||
|
||||
MutexAutoLock lock(mTreeManager->mTreeLock);
|
||||
if (mTreeManager->mRootNode) {
|
||||
ForEachNode<ReverseIterator>(mTreeManager->mRootNode.get(),
|
||||
[](HitTestingTreeNode* aNode)
|
||||
{
|
||||
if (aNode->IsPrimaryHolder()) {
|
||||
MOZ_ASSERT(aNode->GetApzc());
|
||||
aNode->GetApzc()->FlushActiveCheckerboardReport();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (XRE_IsGPUProcess()) {
|
||||
if (gfx::GPUParent* gpu = gfx::GPUParent::GetSingleton()) {
|
||||
nsCString topic("APZ:FlushActiveCheckerboard:Done");
|
||||
Unused << gpu->SendNotifyUiObservers(topic);
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
obsSvc->NotifyObservers(nullptr, "APZ:FlushActiveCheckerboard:Done", nullptr);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/*static*/ const ScreenMargin
|
||||
APZCTreeManager::CalculatePendingDisplayPort(
|
||||
const FrameMetrics& aFrameMetrics,
|
||||
|
@ -169,8 +98,7 @@ APZCTreeManager::APZCTreeManager()
|
|||
mTreeLock("APZCTreeLock"),
|
||||
mHitResultForInputBlock(HitNothing),
|
||||
mRetainedTouchIdentifier(-1),
|
||||
mApzcTreeLog("apzctree"),
|
||||
mFlushObserver(new CheckerboardFlushObserver(this))
|
||||
mApzcTreeLog("apzctree")
|
||||
{
|
||||
AsyncPanZoomController::InitializeGlobalState();
|
||||
mApzcTreeLog.ConditionOnPrefFunction(gfxPrefs::APZPrintTree);
|
||||
|
@ -1347,12 +1275,6 @@ APZCTreeManager::ClearTree()
|
|||
nodesToDestroy[i]->Destroy();
|
||||
}
|
||||
mRootNode = nullptr;
|
||||
|
||||
RefPtr<APZCTreeManager> self(this);
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction([self] {
|
||||
self->mFlushObserver->Unregister();
|
||||
self->mFlushObserver = nullptr;
|
||||
}));
|
||||
}
|
||||
|
||||
RefPtr<HitTestingTreeNode>
|
||||
|
|
|
@ -242,10 +242,10 @@ public:
|
|||
|
||||
/**
|
||||
* Calls Destroy() on all APZC instances attached to the tree, and resets the
|
||||
* tree back to empty. This function must be called exactly once during the
|
||||
* lifetime of this APZCTreeManager, when this APZCTreeManager is no longer
|
||||
* needed. Failing to call this function may prevent objects from being freed
|
||||
* properly.
|
||||
* tree back to empty. This function may be called multiple times during the
|
||||
* lifetime of this APZCTreeManager, but it must always be called at least once
|
||||
* when this APZCTreeManager is no longer needed. Failing to call this function
|
||||
* may prevent objects from being freed properly.
|
||||
*/
|
||||
void ClearTree();
|
||||
|
||||
|
@ -518,10 +518,6 @@ private:
|
|||
* pref). */
|
||||
gfx::TreeLog mApzcTreeLog;
|
||||
|
||||
class CheckerboardFlushObserver;
|
||||
friend class CheckerboardFlushObserver;
|
||||
RefPtr<CheckerboardFlushObserver> mFlushObserver;
|
||||
|
||||
static float sDPI;
|
||||
};
|
||||
|
||||
|
|
|
@ -3241,14 +3241,7 @@ AsyncPanZoomController::ReportCheckerboard(const TimeStamp& aSampleTime)
|
|||
if (magnitude) {
|
||||
mPotentialCheckerboardTracker.CheckerboardSeen();
|
||||
}
|
||||
UpdateCheckerboardEvent(lock, magnitude);
|
||||
}
|
||||
|
||||
void
|
||||
AsyncPanZoomController::UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLock,
|
||||
uint32_t aMagnitude)
|
||||
{
|
||||
if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(aMagnitude)) {
|
||||
if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(magnitude)) {
|
||||
// This checkerboard event is done. Report some metrics to telemetry.
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
|
||||
mCheckerboardEvent->GetSeverity());
|
||||
|
@ -3259,7 +3252,7 @@ AsyncPanZoomController::UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLoc
|
|||
|
||||
mPotentialCheckerboardTracker.CheckerboardDone();
|
||||
|
||||
if (gfxPrefs::APZRecordCheckerboarding()) {
|
||||
if (recordTrace) {
|
||||
// if the pref is enabled, also send it to the storage class. it may be
|
||||
// chosen for public display on about:checkerboard, the hall of fame for
|
||||
// checkerboard events.
|
||||
|
@ -3271,15 +3264,6 @@ AsyncPanZoomController::UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLoc
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AsyncPanZoomController::FlushActiveCheckerboardReport()
|
||||
{
|
||||
MutexAutoLock lock(mCheckerboardEventLock);
|
||||
// Pretend like we got a frame with 0 pixels checkerboarded. This will
|
||||
// terminate the checkerboard event and flush it out
|
||||
UpdateCheckerboardEvent(lock, 0);
|
||||
}
|
||||
|
||||
bool AsyncPanZoomController::IsCurrentlyCheckerboarding() const {
|
||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||
|
||||
|
|
|
@ -234,15 +234,6 @@ public:
|
|||
*/
|
||||
void ReportCheckerboard(const TimeStamp& aSampleTime);
|
||||
|
||||
/**
|
||||
* Flush any active checkerboard report that's in progress. This basically
|
||||
* pretends like any in-progress checkerboard event has terminated, and pushes
|
||||
* out the report to the checkerboard reporting service and telemetry. If the
|
||||
* checkerboard event has not really finished, it will start a new event
|
||||
* on the next composite.
|
||||
*/
|
||||
void FlushActiveCheckerboardReport();
|
||||
|
||||
/**
|
||||
* Returns whether or not the APZC is currently in a state of checkerboarding.
|
||||
* This is a simple computation based on the last-painted content and whether
|
||||
|
@ -1176,10 +1167,6 @@ private:
|
|||
* recording.
|
||||
*/
|
||||
private:
|
||||
// Helper function to update the in-progress checkerboard event, if any.
|
||||
void UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLock,
|
||||
uint32_t aMagnitude);
|
||||
|
||||
// Mutex protecting mCheckerboardEvent
|
||||
Mutex mCheckerboardEventLock;
|
||||
// This is created when this APZC instance is first included as part of a
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/CheckerboardReportServiceBinding.h" // for dom::CheckerboardReports
|
||||
#include "mozilla/gfx/GPUParent.h"
|
||||
#include "mozilla/gfx/GPUProcessManager.h"
|
||||
#include "nsContentUtils.h" // for nsContentUtils
|
||||
#include "nsXULAppAPI.h"
|
||||
|
||||
|
@ -208,21 +207,5 @@ CheckerboardReportService::SetRecordingEnabled(bool aEnabled)
|
|||
gfxPrefs::SetAPZRecordCheckerboarding(aEnabled);
|
||||
}
|
||||
|
||||
void
|
||||
CheckerboardReportService::FlushActiveReports()
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get();
|
||||
if (gpu && gpu->NotifyGpuObservers("APZ:FlushActiveCheckerboard")) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
MOZ_ASSERT(obsSvc);
|
||||
if (obsSvc) {
|
||||
obsSvc->NotifyObservers(nullptr, "APZ:FlushActiveCheckerboard", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -130,7 +130,6 @@ public:
|
|||
void GetReports(nsTArray<dom::CheckerboardReport>& aOutReports);
|
||||
bool IsRecordingEnabled() const;
|
||||
void SetRecordingEnabled(bool aEnabled);
|
||||
void FlushActiveReports();
|
||||
|
||||
private:
|
||||
virtual ~CheckerboardReportService() {}
|
||||
|
|
|
@ -40,10 +40,6 @@ function toggleEnabled() {
|
|||
updateEnabled();
|
||||
}
|
||||
|
||||
function flushReports() {
|
||||
service.flushActiveReports();
|
||||
}
|
||||
|
||||
function showReport(index) {
|
||||
trace.value = reports[index].log;
|
||||
loadData();
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
<body onload="onLoad()">
|
||||
<p>Checkerboard recording is <span id="enabled" style="color: red">undetermined</span>.
|
||||
<button onclick="toggleEnabled()">Toggle it!</button>.</p>
|
||||
<p>If there are active reports in progress, you can stop and flush them by clicking here:
|
||||
<button onclick="flushReports()">Flush active reports</button></p>
|
||||
<table class="listing" cellspacing="0">
|
||||
<tr>
|
||||
<th>Most severe checkerboarding reports</th>
|
||||
|
|
Загрузка…
Ссылка в новой задаче