Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1226826) for widespread bustage
Browse files Browse the repository at this point in the history
Backed out changeset 95d373bec568 (bug 1226826)
Backed out changeset bb9970d440a4 (bug 1226826)
Backed out changeset 6c1fa0dc6bd7 (bug 1226826)
Backed out changeset 400ebf504171 (bug 1226826)

--HG--
extra : commitid : D1zZSeIHTOA
  • Loading branch information
nigelbabu committed Jan 14, 2016
1 parent 6efc978 commit ecae6cd
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 536 deletions.
1 change: 0 additions & 1 deletion dom/base/nsGkAtomList.h
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,6 @@ GK_ATOM(baseURIProperty, "baseURIProperty")
GK_ATOM(lockedStyleStates, "lockedStyleStates")
GK_ATOM(apzCallbackTransform, "apzCallbackTransform")
GK_ATOM(restylableAnonymousNode, "restylableAnonymousNode")
GK_ATOM(paintRequestTime, "PaintRequestTime")

// Languages for lang-specific transforms
GK_ATOM(Japanese, "ja")
Expand Down
2 changes: 0 additions & 2 deletions gfx/ipc/GfxMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
WriteParam(aMsg, aParam.mPageScrollAmount);
WriteParam(aMsg, aParam.mClipRect);
WriteParam(aMsg, aParam.mMaskLayerIndex);
WriteParam(aMsg, aParam.mPaintRequestTime);
WriteParam(aMsg, aParam.mIsRootContent);
WriteParam(aMsg, aParam.mHasScrollgrab);
WriteParam(aMsg, aParam.mUpdateScrollOffset);
Expand Down Expand Up @@ -762,7 +761,6 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) &&
ReadParam(aMsg, aIter, &aResult->mClipRect) &&
ReadParam(aMsg, aIter, &aResult->mMaskLayerIndex) &&
ReadParam(aMsg, aIter, &aResult->mPaintRequestTime) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetIsRootContent) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetHasScrollgrab) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetUpdateScrollOffset) &&
Expand Down
13 changes: 0 additions & 13 deletions gfx/layers/FrameMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "mozilla/gfx/Rect.h" // for RoundedIn
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
#include "mozilla/gfx/Logging.h" // for Log
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "nsString.h"

namespace IPC {
Expand Down Expand Up @@ -64,7 +63,6 @@ struct FrameMetrics {
, mPageScrollAmount(0, 0)
, mClipRect()
, mMaskLayerIndex()
, mPaintRequestTime()
, mIsRootContent(false)
, mHasScrollgrab(false)
, mUpdateScrollOffset(false)
Expand Down Expand Up @@ -106,7 +104,6 @@ struct FrameMetrics {
mPageScrollAmount == aOther.mPageScrollAmount &&
mClipRect == aOther.mClipRect &&
mMaskLayerIndex == aOther.mMaskLayerIndex &&
mPaintRequestTime == aOther.mPaintRequestTime &&
mIsRootContent == aOther.mIsRootContent &&
mHasScrollgrab == aOther.mHasScrollgrab &&
mUpdateScrollOffset == aOther.mUpdateScrollOffset &&
Expand Down Expand Up @@ -543,13 +540,6 @@ struct FrameMetrics {
return mMaskLayerIndex;
}

void SetPaintRequestTime(const TimeStamp& aTime) {
mPaintRequestTime = aTime;
}
const TimeStamp& GetPaintRequestTime() const {
return mPaintRequestTime;
}

void SetIsLayersIdRoot(bool aValue) {
mIsLayersIdRoot = aValue;
}
Expand Down Expand Up @@ -732,9 +722,6 @@ struct FrameMetrics {
// the Layer.
Maybe<size_t> mMaskLayerIndex;

// The time at which the APZC last requested a repaint for this scrollframe.
TimeStamp mPaintRequestTime;

// Whether or not this is the root scroll frame for the root content document.
bool mIsRootContent:1;

Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/apz/src/APZCTreeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,

APZCTM_LOG("Using APZC %p for layer %p with identifiers %" PRId64 " %" PRId64 "\n", apzc, aLayer.GetLayer(), aLayersId, aMetrics.GetScrollId());

apzc->NotifyLayersUpdated(aMetrics, aState.mIsFirstPaint,
aLayersId == aState.mOriginatingLayersId);
apzc->NotifyLayersUpdated(aMetrics,
aState.mIsFirstPaint && (aLayersId == aState.mOriginatingLayersId));

// Since this is the first time we are encountering an APZC with this guid,
// the node holding it must be the primary holder. It may be newly-created
Expand Down
113 changes: 33 additions & 80 deletions gfx/layers/apz/src/AsyncPanZoomController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <algorithm> // for max, min
#include "AsyncPanZoomController.h" // for AsyncPanZoomController, etc
#include "Axis.h" // for AxisX, AxisY, Axis, etc
#include "CheckerboardEvent.h" // for CheckerboardEvent
#include "Compositor.h" // for Compositor
#include "FrameMetrics.h" // for FrameMetrics, etc
#include "GestureEventListener.h" // for GestureEventListener
Expand All @@ -26,7 +25,6 @@
#include "base/tracked.h" // for FROM_HERE
#include "gfxPrefs.h" // for gfxPrefs
#include "gfxTypes.h" // for gfxFloat
#include "LayersLogging.h" // for print_stderr
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/BasicEvents.h" // for Modifiers, MODIFIER_*
#include "mozilla/ClearOnShutdown.h" // for ClearOnShutdown
Expand Down Expand Up @@ -69,10 +67,13 @@
#include "SharedMemoryBasic.h" // for SharedMemoryBasic
#include "WheelScrollAnimation.h"

// #define APZC_ENABLE_RENDERTRACE

#define ENABLE_APZC_LOGGING 0
// #define ENABLE_APZC_LOGGING 1

#if ENABLE_APZC_LOGGING
# include "LayersLogging.h"
# define APZC_LOG(...) printf_stderr("APZC: " __VA_ARGS__)
# define APZC_LOG_FM(fm, prefix, ...) \
{ std::stringstream ss; \
Expand Down Expand Up @@ -275,9 +276,6 @@ using mozilla::gfx::PointTyped;
* Maximum amount of time while panning before sending a viewport change. This
* will asynchronously repaint the page. It is also forced when panning stops.
*
* \li\b apz.record_checkerboarding
* Whether or not to record detailed info on checkerboarding events.
*
* \li\b apz.smooth_scroll_repaint_interval
* Maximum amount of time doing a smooth scroll before sending a viewport
* change. This will asynchronously repaint the page.\n
Expand Down Expand Up @@ -390,6 +388,18 @@ static bool IsCloseToVertical(float aAngle, float aThreshold)
return (fabs(aAngle - (M_PI / 2)) < aThreshold);
}

static inline void LogRendertraceRect(const ScrollableLayerGuid& aGuid, const char* aDesc, const char* aColor, const CSSRect& aRect)
{
#ifdef APZC_ENABLE_RENDERTRACE
static const TimeStamp sRenderStart = TimeStamp::Now();
TimeDuration delta = TimeStamp::Now() - sRenderStart;
printf_stderr("(%llu,%lu,%llu)%s RENDERTRACE %f rect %s %f %f %f %f\n",
aGuid.mLayersId, aGuid.mPresShellId, aGuid.mScrollId,
aDesc, delta.ToMilliseconds(), aColor,
aRect.x, aRect.y, aRect.width, aRect.height);
#endif
}

// Counter used to give each APZC a unique id
static uint32_t sAsyncPanZoomControllerCount = 0;

Expand Down Expand Up @@ -2802,10 +2812,8 @@ void AsyncPanZoomController::RequestContentRepaint() {
RequestContentRepaint(mFrameMetrics);
}

void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics)
{
ParentLayerPoint velocity = GetVelocityVector();
aFrameMetrics.SetDisplayPortMargins(CalculatePendingDisplayPort(aFrameMetrics, velocity));
void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics) {
aFrameMetrics.SetDisplayPortMargins(CalculatePendingDisplayPort(aFrameMetrics, GetVelocityVector()));
aFrameMetrics.SetUseDisplayPortMargins(true);

// If we're trying to paint what we already think is painted, discard this
Expand All @@ -2829,8 +2837,7 @@ void AsyncPanZoomController::RequestContentRepaint(FrameMetrics& aFrameMetrics)
return;
}

aFrameMetrics.SetPaintRequestTime(TimeStamp::Now());
DispatchRepaintRequest(aFrameMetrics, velocity);
DispatchRepaintRequest(aFrameMetrics);
aFrameMetrics.SetPresShellId(mLastContentPaintMetrics.GetPresShellId());
}

Expand All @@ -2846,23 +2853,14 @@ GetDisplayPortRect(const FrameMetrics& aFrameMetrics)
}

void
AsyncPanZoomController::DispatchRepaintRequest(const FrameMetrics& aFrameMetrics,
const ParentLayerPoint& aVelocity)
{
AsyncPanZoomController::DispatchRepaintRequest(const FrameMetrics& aFrameMetrics) {
RefPtr<GeckoContentController> controller = GetGeckoContentController();
if (!controller) {
return;
}

APZC_LOG_FM(aFrameMetrics, "%p requesting content repaint", this);
if (mCheckerboardEvent) {
std::stringstream info;
info << " velocity " << aVelocity;
std::string str = info.str();
mCheckerboardEvent->UpdateRendertraceProperty(
CheckerboardEvent::RequestedDisplayPort, GetDisplayPortRect(aFrameMetrics),
str);
}
LogRendertraceRect(GetGuid(), "requested displayport", "yellow", GetDisplayPortRect(aFrameMetrics));

if (NS_IsMainThread()) {
controller->RequestContentRepaint(aFrameMetrics);
Expand Down Expand Up @@ -2970,12 +2968,9 @@ bool AsyncPanZoomController::AdvanceAnimations(const TimeStamp& aSampleTime)

requestAnimationFrame = UpdateAnimation(aSampleTime, &deferredTasks);

if (mCheckerboardEvent) {
mCheckerboardEvent->UpdateRendertraceProperty(
CheckerboardEvent::UserVisible,
CSSRect(mFrameMetrics.GetScrollOffset(),
mFrameMetrics.CalculateCompositedSizeInCssPixels()));
}
LogRendertraceRect(GetGuid(), "viewport", "red",
CSSRect(mFrameMetrics.GetScrollOffset(),
mFrameMetrics.CalculateCompositedSizeInCssPixels()));
}

// Execute any deferred tasks queued up by mAnimation's Sample() (called by
Expand Down Expand Up @@ -3097,19 +3092,6 @@ AsyncPanZoomController::ReportCheckerboard(const TimeStamp& aSampleTime)
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::CHECKERBOARDED_CSSPIXELS_MS, magnitude * time);
mLastCheckerboardReport = aSampleTime;

if (!mCheckerboardEvent && gfxPrefs::APZRecordCheckerboarding()) {
mCheckerboardEvent = MakeUnique<CheckerboardEvent>();
}
if (mCheckerboardEvent) {
if (mCheckerboardEvent->RecordFrameInfo(aSampleTime, magnitude)) {
// This checkerboard event is done. TODO: save the info somewhere or
// dispatch it to telemetry or something. For now we just print it.
std::stringstream log(mCheckerboardEvent->GetLog());
print_stderr(log);
mCheckerboardEvent = nullptr;
}
}
}

bool AsyncPanZoomController::IsCurrentlyCheckerboarding() const {
Expand All @@ -3131,10 +3113,7 @@ bool AsyncPanZoomController::IsCurrentlyCheckerboarding() const {
return true;
}

void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetrics,
bool aIsFirstPaint,
bool aThisLayerTreeUpdated)
{
void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetrics, bool aIsFirstPaint) {
APZThreadUtils::AssertOnCompositorThread();

ReentrantMonitorAutoEnter lock(mMonitor);
Expand All @@ -3143,40 +3122,14 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
mLastContentPaintMetrics = aLayerMetrics;

mFrameMetrics.SetScrollParentId(aLayerMetrics.GetScrollParentId());
APZC_LOG_FM(aLayerMetrics, "%p got a NotifyLayersUpdated with aIsFirstPaint=%d, aThisLayerTreeUpdated=%d",
this, aIsFirstPaint, aThisLayerTreeUpdated);

if (mCheckerboardEvent) {
std::string str;
if (aThisLayerTreeUpdated) {
if (!aLayerMetrics.GetPaintRequestTime().IsNull()) {
// Note that we might get the paint request time as non-null, but with
// aThisLayerTreeUpdated false. That can happen if we get a layer transaction
// from a different process right after we get the layer transaction with
// aThisLayerTreeUpdated == true. In this case we want to ignore the
// paint request time because it was already dumped in the previous layer
// transaction.
TimeDuration paintTime = TimeStamp::Now() - aLayerMetrics.GetPaintRequestTime();
std::stringstream info;
info << " painttime " << paintTime.ToMilliseconds();
str = info.str();
} else {
// This might be indicative of a wasted paint particularly if it happens
// during a checkerboard event.
str = " (this layertree updated)";
}
}
mCheckerboardEvent->UpdateRendertraceProperty(
CheckerboardEvent::Page, aLayerMetrics.GetScrollableRect());
mCheckerboardEvent->UpdateRendertraceProperty(
CheckerboardEvent::PaintedDisplayPort,
aLayerMetrics.GetDisplayPort() + aLayerMetrics.GetScrollOffset(),
str);
if (!aLayerMetrics.GetCriticalDisplayPort().IsEmpty()) {
mCheckerboardEvent->UpdateRendertraceProperty(
CheckerboardEvent::PaintedCriticalDisplayPort,
aLayerMetrics.GetCriticalDisplayPort() + aLayerMetrics.GetScrollOffset());
}
APZC_LOG_FM(aLayerMetrics, "%p got a NotifyLayersUpdated with aIsFirstPaint=%d", this, aIsFirstPaint);

LogRendertraceRect(GetGuid(), "page", "brown", aLayerMetrics.GetScrollableRect());
LogRendertraceRect(GetGuid(), "painted displayport", "lightgreen",
aLayerMetrics.GetDisplayPort() + aLayerMetrics.GetScrollOffset());
if (!aLayerMetrics.GetCriticalDisplayPort().IsEmpty()) {
LogRendertraceRect(GetGuid(), "painted critical displayport", "darkgreen",
aLayerMetrics.GetCriticalDisplayPort() + aLayerMetrics.GetScrollOffset());
}

bool needContentRepaint = false;
Expand Down Expand Up @@ -3206,7 +3159,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
// TODO if we're in a drag and scrollOffsetUpdated is set then we want to
// ignore it

if ((aIsFirstPaint && aThisLayerTreeUpdated) || isDefault) {
if (aIsFirstPaint || isDefault) {
// Initialize our internal state to something sane when the content
// that was just painted is something we knew nothing about previously
CancelAnimation();
Expand Down
18 changes: 2 additions & 16 deletions gfx/layers/apz/src/AsyncPanZoomController.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class TouchBlockState;
class PanGestureBlockState;
class OverscrollHandoffChain;
class StateChangeNotificationBlocker;
class CheckerboardEvent;

/**
* Controller for all panning and zooming logic. Any time a user input is
Expand Down Expand Up @@ -183,8 +182,7 @@ class AsyncPanZoomController {
* layers code indicating that the frame metrics being sent with this call are
* the initial metrics and the initial paint of the frame has just happened.
*/
void NotifyLayersUpdated(const FrameMetrics& aLayerMetrics, bool aIsFirstPaint,
bool aThisLayerTreeUpdated);
void NotifyLayersUpdated(const FrameMetrics& aLayerMetrics, bool aIsFirstPaint);

/**
* The platform implementation must set the compositor parent so that we can
Expand Down Expand Up @@ -596,8 +594,7 @@ class AsyncPanZoomController {
/**
* Actually send the next pending paint request to gecko.
*/
void DispatchRepaintRequest(const FrameMetrics& aFrameMetrics,
const ParentLayerPoint& aVelocity);
void DispatchRepaintRequest(const FrameMetrics& aFrameMetrics);

/**
* Gets the current frame metrics. This is *not* the Gecko copy stored in the
Expand Down Expand Up @@ -1102,17 +1099,6 @@ class AsyncPanZoomController {
// Flag to track whether or not the APZ transform is not used. This
// flag is recomputed for every composition frame.
bool mAsyncTransformAppliedToContent;


/* ===================================================================
* The functions and members in this section are used for checkerboard
* recording.
*/
private:
// This is created when this APZC instance is first included as part of a
// composite. If a checkerboard event takes place, this is destroyed at the
// end of the event, and a new one is created on the next composite.
UniquePtr<CheckerboardEvent> mCheckerboardEvent;
};

} // namespace layers
Expand Down
Loading

0 comments on commit ecae6cd

Please sign in to comment.