Backed out changeset 01dd7c0d8f8d (bug 1002754) for gtest failures.

This commit is contained in:
Ryan VanderMeulen 2014-05-01 12:55:02 -04:00
Родитель 22bf56948c
Коммит 7fdf15b4dd
3 изменённых файлов: 15 добавлений и 32 удалений

Просмотреть файл

@ -200,9 +200,7 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
apzc = new AsyncPanZoomController(aLayersId, this, state->mController,
AsyncPanZoomController::USE_GESTURE_DETECTOR);
apzc->SetCompositorParent(aCompositor);
if (state->mCrossProcessParent != nullptr) {
apzc->ShareFrameMetricsAcrossProcesses();
}
apzc->SetCrossProcessCompositorParent(state->mCrossProcessParent);
} else {
// If there was already an APZC for the layer clear the tree pointers
// so that it doesn't continue pointing to APZCs that should no longer

Просмотреть файл

@ -10,7 +10,6 @@
#include <algorithm> // for max, min
#include "AnimationCommon.h" // for ComputedTimingFunction
#include "AsyncPanZoomController.h" // for AsyncPanZoomController, etc
#include "Compositor.h" // for Compositor
#include "CompositorParent.h" // for CompositorParent
#include "FrameMetrics.h" // for FrameMetrics, etc
#include "GestureEventListener.h" // for GestureEventListener
@ -461,10 +460,10 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
GeckoContentController* aGeckoContentController,
GestureBehavior aGestures)
: mLayersId(aLayersId),
mCrossProcessCompositorParent(nullptr),
mPaintThrottler(GetFrameTime()),
mGeckoContentController(aGeckoContentController),
mRefPtrMonitor("RefPtrMonitor"),
mSharingFrameMetricsAcrossProcesses(false),
mMonitor("AsyncPanZoomController"),
mTouchActionPropertyEnabled(gfxPrefs::TouchActionEnabled()),
mContentResponseTimeoutTask(nullptr),
@ -493,7 +492,9 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
}
AsyncPanZoomController::~AsyncPanZoomController() {
PCompositorParent* compositor = GetSharedFrameMetricsCompositor();
PCompositorParent* compositor =
(mCrossProcessCompositorParent ? mCrossProcessCompositorParent : mCompositorParent.get());
// Only send the release message if the SharedFrameMetrics has been created.
if (compositor && mSharedFrameMetricsBuffer) {
@ -506,19 +507,6 @@ AsyncPanZoomController::~AsyncPanZoomController() {
MOZ_COUNT_DTOR(AsyncPanZoomController);
}
PCompositorParent*
AsyncPanZoomController::GetSharedFrameMetricsCompositor()
{
Compositor::AssertOnCompositorThread();
if (mSharingFrameMetricsAcrossProcesses) {
const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(mLayersId);
// |state| may be null here if the CrossProcessCompositorParent has already been destroyed.
return state ? state->mCrossProcessParent : nullptr;
}
return mCompositorParent.get();
}
already_AddRefed<GeckoContentController>
AsyncPanZoomController::GetGeckoContentController() {
MonitorAutoLock lock(mRefPtrMonitor);
@ -1406,8 +1394,8 @@ void AsyncPanZoomController::SetCompositorParent(CompositorParent* aCompositorPa
mCompositorParent = aCompositorParent;
}
void AsyncPanZoomController::ShareFrameMetricsAcrossProcesses() {
mSharingFrameMetricsAcrossProcesses = true;
void AsyncPanZoomController::SetCrossProcessCompositorParent(PCompositorParent* aCrossProcessCompositorParent) {
mCrossProcessCompositorParent = aCrossProcessCompositorParent;
}
void AsyncPanZoomController::ScrollBy(const CSSPoint& aOffset) {
@ -2220,7 +2208,8 @@ void AsyncPanZoomController::UpdateSharedCompositorFrameMetrics()
void AsyncPanZoomController::ShareCompositorFrameMetrics() {
PCompositorParent* compositor = GetSharedFrameMetricsCompositor();
PCompositorParent* compositor =
(mCrossProcessCompositorParent ? mCrossProcessCompositorParent : mCompositorParent.get());
// Only create the shared memory buffer if it hasn't already been created,
// we are using progressive tile painting, and we have a

Просмотреть файл

@ -185,11 +185,12 @@ public:
void SetCompositorParent(CompositorParent* aCompositorParent);
/**
* Inform this APZC that it will be sharing its FrameMetrics with a cross-process
* compositor so that the associated content process can access it. This is only
* relevant when progressive painting is enabled.
* The platform implementation must set the cross process compositor if
* there is one associated with the layer tree. The cross process compositor
* allows the APZC to share its FrameMetrics with the content process.
* The shared FrameMetrics is used in progressive paint updates.
*/
void ShareFrameMetricsAcrossProcesses();
void SetCrossProcessCompositorParent(PCompositorParent* aCrossProcessCompositorParent);
// --------------------------------------------------------------------------
// These methods can be called from any thread.
@ -652,6 +653,7 @@ private:
uint64_t mLayersId;
nsRefPtr<CompositorParent> mCompositorParent;
PCompositorParent* mCrossProcessCompositorParent;
TaskThrottler mPaintThrottler;
/* Access to the following two fields is protected by the mRefPtrMonitor,
@ -665,12 +667,6 @@ private:
already_AddRefed<GeckoContentController> GetGeckoContentController();
already_AddRefed<GestureEventListener> GetGestureEventListener();
// If we are sharing our frame metrics with content across processes
bool mSharingFrameMetricsAcrossProcesses;
/* Utility function to get the Compositor with which we share the FrameMetrics.
This function is only callable from the compositor thread. */
PCompositorParent* GetSharedFrameMetricsCompositor();
protected:
// Both |mFrameMetrics| and |mLastContentPaintMetrics| are protected by the
// monitor. Do not read from or modify either of them without locking.