Backed out changeset 65f06a1e7b1b (bug 799401) for Windows build bustage.
This commit is contained in:
@@ -142,7 +142,6 @@ EXPORTS_mozilla/layers =\
|
|||||||
RenderTrace.h \
|
RenderTrace.h \
|
||||||
SharedImageUtils.h \
|
SharedImageUtils.h \
|
||||||
ShmemYCbCrImage.h \
|
ShmemYCbCrImage.h \
|
||||||
TaskThrottler.h \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
CPPSRCS += \
|
CPPSRCS += \
|
||||||
@@ -162,7 +161,6 @@ CPPSRCS += \
|
|||||||
ShadowLayerParent.cpp \
|
ShadowLayerParent.cpp \
|
||||||
ShadowLayersParent.cpp \
|
ShadowLayersParent.cpp \
|
||||||
ShmemYCbCrImage.cpp \
|
ShmemYCbCrImage.cpp \
|
||||||
TaskThrottler.cpp \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef MOZ_X11 #{
|
ifdef MOZ_X11 #{
|
||||||
|
|||||||
@@ -967,11 +967,7 @@ void AsyncPanZoomController::RequestContentRepaint() {
|
|||||||
// This message is compressed, so fire whether or not we already have a paint
|
// This message is compressed, so fire whether or not we already have a paint
|
||||||
// queued up. We need to know whether or not a paint was requested anyways,
|
// queued up. We need to know whether or not a paint was requested anyways,
|
||||||
// for the purposes of content calling window.scrollTo().
|
// for the purposes of content calling window.scrollTo().
|
||||||
mPaintThrottler.PostTask(
|
mGeckoContentController->RequestContentRepaint(mFrameMetrics);
|
||||||
FROM_HERE,
|
|
||||||
NewRunnableMethod(mGeckoContentController.get(),
|
|
||||||
&GeckoContentController::RequestContentRepaint,
|
|
||||||
mFrameMetrics));
|
|
||||||
mLastPaintRequestMetrics = mFrameMetrics;
|
mLastPaintRequestMetrics = mFrameMetrics;
|
||||||
mWaitingForContentToPaint = true;
|
mWaitingForContentToPaint = true;
|
||||||
|
|
||||||
@@ -1085,8 +1081,6 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
|
|||||||
void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aViewportFrame, bool aIsFirstPaint) {
|
void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aViewportFrame, bool aIsFirstPaint) {
|
||||||
MonitorAutoLock monitor(mMonitor);
|
MonitorAutoLock monitor(mMonitor);
|
||||||
|
|
||||||
mPaintThrottler.TaskComplete();
|
|
||||||
|
|
||||||
mLastContentPaintMetrics = aViewportFrame;
|
mLastContentPaintMetrics = aViewportFrame;
|
||||||
|
|
||||||
if (mWaitingForContentToPaint) {
|
if (mWaitingForContentToPaint) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "InputData.h"
|
#include "InputData.h"
|
||||||
#include "Axis.h"
|
#include "Axis.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "TaskThrottler.h"
|
|
||||||
|
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop.h"
|
||||||
|
|
||||||
@@ -459,7 +458,6 @@ private:
|
|||||||
void SetState(PanZoomState aState);
|
void SetState(PanZoomState aState);
|
||||||
|
|
||||||
nsRefPtr<CompositorParent> mCompositorParent;
|
nsRefPtr<CompositorParent> mCompositorParent;
|
||||||
TaskThrottler mPaintThrottler;
|
|
||||||
nsRefPtr<GeckoContentController> mGeckoContentController;
|
nsRefPtr<GeckoContentController> mGeckoContentController;
|
||||||
nsRefPtr<GestureEventListener> mGestureEventListener;
|
nsRefPtr<GestureEventListener> mGestureEventListener;
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
|
|
||||||
/* vim: set sw=2 sts=2 ts=8 et tw=80 : */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/message_loop.h"
|
|
||||||
#include "TaskThrottler.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
namespace layers {
|
|
||||||
|
|
||||||
TaskThrottler::TaskThrottler()
|
|
||||||
: mOutstanding(false)
|
|
||||||
, mQueuedTask(nullptr)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
void
|
|
||||||
TaskThrottler::PostTask(const tracked_objects::Location& aLocation,
|
|
||||||
CancelableTask* aTask)
|
|
||||||
{
|
|
||||||
aTask->SetBirthPlace(aLocation);
|
|
||||||
|
|
||||||
if (mOutstanding) {
|
|
||||||
if (mQueuedTask) {
|
|
||||||
mQueuedTask->Cancel();
|
|
||||||
}
|
|
||||||
mQueuedTask = aTask;
|
|
||||||
} else {
|
|
||||||
aTask->Run();
|
|
||||||
delete aTask;
|
|
||||||
mOutstanding = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TaskThrottler::TaskComplete()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mOutstanding);
|
|
||||||
if (mQueuedTask) {
|
|
||||||
mQueuedTask->Run();
|
|
||||||
mQueuedTask = nullptr;
|
|
||||||
} else {
|
|
||||||
mOutstanding = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */
|
|
||||||
/* vim: set sw=4 ts=8 et tw=80 : */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_dom_TaskThrottler_h
|
|
||||||
#define mozilla_dom_TaskThrottler_h
|
|
||||||
|
|
||||||
class CancelableTask;
|
|
||||||
namespace tracked_objects {
|
|
||||||
class Location;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
namespace layers {
|
|
||||||
|
|
||||||
/** The TaskThrottler prevents update event overruns. It is used in cases where
|
|
||||||
* you're sending an async message and waiting for a reply. You need to call
|
|
||||||
* PostTask to queue a task and TaskComplete when you get a response.
|
|
||||||
*
|
|
||||||
* The call to TaskComplete will run the recent task posted since the last
|
|
||||||
* request was sent, if any. This means that at any time there can be at most 1
|
|
||||||
* outstanding request being processed and at most 1 queued behind it.
|
|
||||||
*
|
|
||||||
* This is used in the context of repainting a scrollable region. While another
|
|
||||||
* process is painting you might get several updates from the UI thread but when
|
|
||||||
* the paint is complete you want to send the most recent.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class TaskThrottler {
|
|
||||||
public:
|
|
||||||
TaskThrottler();
|
|
||||||
|
|
||||||
/** Post a task to be run as soon as there are no outstanding tasks.
|
|
||||||
*
|
|
||||||
* @param aLocation Use the macro FROM_HERE
|
|
||||||
* @param aTask Ownership of this object is transferred to TaskThrottler
|
|
||||||
* which will delete it when it is either run or becomes
|
|
||||||
* obsolete or the TaskThrottler is destructed.
|
|
||||||
*/
|
|
||||||
void PostTask(const tracked_objects::Location& aLocation,
|
|
||||||
CancelableTask* aTask);
|
|
||||||
void TaskComplete();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool mOutstanding;
|
|
||||||
nsAutoPtr<CancelableTask> mQueuedTask;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // mozilla_dom_TaskThrottler_h
|
|
||||||
Reference in New Issue
Block a user