From 89a5b6355597549ef1b85cb17d81a16a65fbb73e Mon Sep 17 00:00:00 2001 From: Mason Chang Date: Mon, 8 Jun 2015 09:53:41 -0700 Subject: [PATCH] Bug 1077651 Measure frame uniformity by synthesizing native events. r=kats,mrbkap --- dom/base/nsDOMWindowUtils.cpp | 24 ++- dom/interfaces/base/nsIDOMWindowUtils.idl | 10 +- dom/webidl/APZTestData.webidl | 12 +- gfx/layers/Layers.h | 2 + gfx/layers/apz/test/chrome.ini | 9 ++ gfx/layers/apz/test/test_smoothness.html | 83 ++++++++++ gfx/layers/client/ClientLayerManager.cpp | 15 ++ gfx/layers/client/ClientLayerManager.h | 2 + .../composite/AsyncCompositionManager.cpp | 53 ++++++ .../composite/AsyncCompositionManager.h | 22 +-- gfx/layers/composite/FrameUniformityData.cpp | 151 ++++++++++++++++++ gfx/layers/composite/FrameUniformityData.h | 73 +++++++++ gfx/layers/ipc/CompositorParent.cpp | 15 ++ gfx/layers/ipc/CompositorParent.h | 1 + gfx/layers/ipc/PCompositor.ipdl | 4 + gfx/layers/moz.build | 3 + gfx/thebes/gfxPrefs.h | 1 + 17 files changed, 467 insertions(+), 13 deletions(-) create mode 100644 gfx/layers/apz/test/chrome.ini create mode 100644 gfx/layers/apz/test/test_smoothness.html create mode 100644 gfx/layers/composite/FrameUniformityData.cpp create mode 100644 gfx/layers/composite/FrameUniformityData.h diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index c4ee28fd207..4eab3c81eef 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -70,7 +70,6 @@ #endif #include "Layers.h" -#include "mozilla/layers/ShadowLayers.h" #include "gfxPrefs.h" #include "mozilla/dom/Element.h" @@ -82,6 +81,8 @@ #include "mozilla/dom/PermissionMessageUtils.h" #include "mozilla/dom/quota/PersistenceType.h" #include "mozilla/dom/quota/QuotaManager.h" +#include "mozilla/layers/FrameUniformityData.h" +#include "mozilla/layers/ShadowLayers.h" #include "nsPrintfCString.h" #include "nsViewportInfo.h" #include "nsIFormControl.h" @@ -3716,6 +3717,27 @@ nsDOMWindowUtils::SetChromeMargin(int32_t aTop, return NS_OK; } +NS_IMETHODIMP +nsDOMWindowUtils::GetFrameUniformityTestData(JSContext* aContext, + JS::MutableHandleValue aOutFrameUniformity) +{ + MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); + nsIWidget* widget = GetWidget(); + if (!widget) { + return NS_ERROR_NOT_AVAILABLE; + } + + nsRefPtr manager = widget->GetLayerManager(); + if (!manager) { + return NS_ERROR_NOT_AVAILABLE; + } + + FrameUniformityData outData; + manager->GetFrameUniformity(&outData); + outData.ToJS(aOutFrameUniformity, aContext); + return NS_OK; +} + NS_IMETHODIMP nsDOMWindowUtils::XpconnectArgument(nsIDOMWindowUtils* aThis) { diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index 6e829a74436..10b14e18100 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -49,7 +49,7 @@ interface nsIJSRAIIHelper; interface nsIContentPermissionRequest; interface nsIObserver; -[scriptable, uuid(098d9f0d-7809-4d3c-8fc6-e5b3fb71835b)] +[scriptable, uuid(ec176f3b-2886-4090-938e-dded103c5f1c)] interface nsIDOMWindowUtils : nsISupports { /** @@ -1814,6 +1814,14 @@ interface nsIDOMWindowUtils : nsISupports { attribute boolean serviceWorkersTestingEnabled; /** + * Returns a JSObject which contains a list of frame uniformities + * when the pref gfx.vsync.collect-scroll-data is enabled. + * Every result contains a layer address and a frame uniformity for that layer. + * A negative frame uniformity value indicates an invalid frame uniformity and an error has occured. + */ + [implicit_jscontext] jsval getFrameUniformityTestData(); + + /* * Increase the chaos mode activation level. An equivalent number of * calls to leaveChaosMode must be made in order to restore the original * chaos mode state. If the activation level is nonzero all chaos mode diff --git a/dom/webidl/APZTestData.webidl b/dom/webidl/APZTestData.webidl index 2eea0c6c232..227f4b0b99d 100644 --- a/dom/webidl/APZTestData.webidl +++ b/dom/webidl/APZTestData.webidl @@ -34,4 +34,14 @@ dictionary APZBucket { dictionary APZTestData { sequence paints; sequence repaintRequests; -}; \ No newline at end of file +}; + +// A frame uniformity measurement for every scrollable layer +dictionary FrameUniformity { + unsigned long layerAddress; + float frameUniformity; +}; + +dictionary FrameUniformityResults { + sequence layerUniformities; +}; diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 8a2b901bd47..342e9a1b552 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -92,6 +92,7 @@ class ShadowLayerForwarder; class LayerManagerComposite; class SpecificLayerAttributes; class Compositor; +class FrameUniformityData; namespace layerscope { class LayersPacket; @@ -643,6 +644,7 @@ public: virtual bool IsCompositingCheap() { return true; } bool IsInTransaction() const { return mInTransaction; } + virtual void GetFrameUniformity(FrameUniformityData* aOutData) { } virtual bool RequestOverfill(mozilla::dom::OverfillCallback* aCallback) { return true; } virtual void RunOverfillCallback(const uint32_t aOverfill) { } diff --git a/gfx/layers/apz/test/chrome.ini b/gfx/layers/apz/test/chrome.ini new file mode 100644 index 00000000000..d52da592879 --- /dev/null +++ b/gfx/layers/apz/test/chrome.ini @@ -0,0 +1,9 @@ +[DEFAULT] +support-files = + apz_test_native_event_utils.js +tags = apz-chrome + +[test_smoothness.html] +# hardware vsync only on win/mac +# e10s only since APZ is only enabled on e10s +skip-if = debug || (os != 'mac' && os != 'win') || !e10s diff --git a/gfx/layers/apz/test/test_smoothness.html b/gfx/layers/apz/test/test_smoothness.html new file mode 100644 index 00000000000..a1c5bfe5b8d --- /dev/null +++ b/gfx/layers/apz/test/test_smoothness.html @@ -0,0 +1,83 @@ + + + Test Frame Uniformity While Scrolling + + + + + + + + + +
+
+ + diff --git a/gfx/layers/client/ClientLayerManager.cpp b/gfx/layers/client/ClientLayerManager.cpp index 2a45dce1385..4371ee169d7 100644 --- a/gfx/layers/client/ClientLayerManager.cpp +++ b/gfx/layers/client/ClientLayerManager.cpp @@ -14,6 +14,7 @@ #include "mozilla/layers/CompositableClient.h" #include "mozilla/layers/CompositorChild.h" // for CompositorChild #include "mozilla/layers/ContentClient.h" +#include "mozilla/layers/FrameUniformityData.h" #include "mozilla/layers/ISurfaceAllocator.h" #include "mozilla/layers/LayersMessages.h" // for EditReply, etc #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor @@ -426,6 +427,20 @@ ClientLayerManager::StartNewRepaintRequest(SequenceNumber aSequenceNumber) } } +void +ClientLayerManager::GetFrameUniformity(FrameUniformityData* aOutData) +{ + MOZ_ASSERT(XRE_IsParentProcess(), "Frame Uniformity only supported in parent process"); + + if (HasShadowManager()) { + CompositorChild* child = GetRemoteRenderer(); + child->SendGetFrameUniformity(aOutData); + return; + } + + return LayerManager::GetFrameUniformity(aOutData); +} + bool ClientLayerManager::RequestOverfill(mozilla::dom::OverfillCallback* aCallback) { diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index 43ffa28578e..482e2caf82f 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -34,6 +34,7 @@ class ClientPaintedLayer; class CompositorChild; class ImageLayer; class PLayerChild; +class FrameUniformityData; class TextureClientPool; class ClientLayerManager final : public LayerManager @@ -200,6 +201,7 @@ public: bool NeedsComposite() const { return mNeedsComposite; } virtual void Composite() override; + virtual void GetFrameUniformity(FrameUniformityData* aFrameUniformityData) override; virtual bool RequestOverfill(mozilla::dom::OverfillCallback* aCallback) override; virtual void RunOverfillCallback(const uint32_t aOverfill) override; diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 71f05734c56..31786dabccb 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -37,6 +37,7 @@ # include "AndroidBridge.h" #endif #include "GeckoProfiler.h" +#include "FrameUniformityData.h" struct nsCSSValueSharedList; @@ -94,6 +95,18 @@ WalkTheTree(Layer* aLayer, } } +AsyncCompositionManager::AsyncCompositionManager(LayerManagerComposite* aManager) + : mLayerManager(aManager) + , mIsFirstPaint(true) + , mLayersUpdated(false) + , mReadyForCompose(true) +{ +} + +AsyncCompositionManager::~AsyncCompositionManager() +{ +} + void AsyncCompositionManager::ResolveRefLayers() { @@ -545,6 +558,36 @@ SampleAPZAnimations(const LayerMetricsWrapper& aLayer, TimeStamp aSampleTime) return activeAnimations; } +void +AsyncCompositionManager::RecordShadowTransforms(Layer* aLayer) +{ + MOZ_ASSERT(gfxPrefs::CollectScrollTransforms()); + MOZ_ASSERT(CompositorParent::IsInCompositorThread()); + + for (Layer* child = aLayer->GetFirstChild(); + child; child = child->GetNextSibling()) { + RecordShadowTransforms(child); + } + + for (uint32_t i = 0; i < aLayer->GetFrameMetricsCount(); i++) { + AsyncPanZoomController* apzc = aLayer->GetAsyncPanZoomController(i); + if (!apzc) { + continue; + } + gfx::Matrix4x4 shadowTransform = aLayer->AsLayerComposite()->GetShadowTransform(); + if (!shadowTransform.Is2D()) { + continue; + } + + Matrix transform = shadowTransform.As2D(); + if (transform.IsTranslation() && !shadowTransform.IsIdentity()) { + Point translation = transform.GetTranslation(); + mLayerTransformRecorder.RecordTransform(aLayer, translation); + return; + } + } +} + Matrix4x4 AdjustForClip(const Matrix4x4& asyncTransform, Layer* aLayer) { @@ -1051,6 +1094,13 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer) aLayer->GetLocalTransform(), fixedLayerMargins); } +void +AsyncCompositionManager::GetFrameUniformity(FrameUniformityData* aOutData) +{ + MOZ_ASSERT(CompositorParent::IsInCompositorThread()); + mLayerTransformRecorder.EndTest(aOutData); +} + bool AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame, TransformsToSkip aSkip) @@ -1103,6 +1153,9 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame, trans *= gfx::Matrix4x4::From2D(mWorldTransform); rootComposite->SetShadowTransform(trans); + if (gfxPrefs::CollectScrollTransforms()) { + RecordShadowTransforms(root); + } return wantNextFrame; } diff --git a/gfx/layers/composite/AsyncCompositionManager.h b/gfx/layers/composite/AsyncCompositionManager.h index 50810af7f3e..fa3ec48cad9 100644 --- a/gfx/layers/composite/AsyncCompositionManager.h +++ b/gfx/layers/composite/AsyncCompositionManager.h @@ -14,6 +14,7 @@ #include "mozilla/dom/ScreenOrientation.h" // for ScreenOrientation #include "mozilla/gfx/BasePoint.h" // for BasePoint #include "mozilla/gfx/Matrix.h" // for Matrix4x4 +#include "mozilla/layers/FrameUniformityData.h" // For FrameUniformityData #include "mozilla/layers/LayersMessages.h" // for TargetConfig #include "nsRefPtr.h" // for nsRefPtr #include "nsISupportsImpl.h" // for LayerManager::AddRef, etc @@ -70,19 +71,12 @@ struct ViewTransform { class AsyncCompositionManager final { friend class AutoResolveRefLayers; - ~AsyncCompositionManager() - { - } + ~AsyncCompositionManager(); + public: NS_INLINE_DECL_REFCOUNTING(AsyncCompositionManager) - explicit AsyncCompositionManager(LayerManagerComposite* aManager) - : mLayerManager(aManager) - , mIsFirstPaint(true) - , mLayersUpdated(false) - , mReadyForCompose(true) - { - } + explicit AsyncCompositionManager(LayerManagerComposite* aManager); /** * This forces the is-first-paint flag to true. This is intended to @@ -123,6 +117,10 @@ public: // particular document. bool IsFirstPaint() { return mIsFirstPaint; } + // GetFrameUniformity will return the frame uniformity for each layer attached to an APZ + // from the recorded data in RecordShadowTransform + void GetFrameUniformity(FrameUniformityData* aFrameUniformityData); + private: void TransformScrollableLayer(Layer* aLayer); // Return true if an AsyncPanZoomController content transform was @@ -190,6 +188,9 @@ private: */ void DetachRefLayers(); + // Records the shadow transforms for the tree of layers rooted at the given layer + void RecordShadowTransforms(Layer* aLayer); + TargetConfig mTargetConfig; CSSRect mContentRect; @@ -208,6 +209,7 @@ private: bool mReadyForCompose; gfx::Matrix mWorldTransform; + LayerTransformRecorder mLayerTransformRecorder; }; MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AsyncCompositionManager::TransformsToSkip) diff --git a/gfx/layers/composite/FrameUniformityData.cpp b/gfx/layers/composite/FrameUniformityData.cpp new file mode 100644 index 00000000000..eb2c3db7892 --- /dev/null +++ b/gfx/layers/composite/FrameUniformityData.cpp @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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 "FrameUniformityData.h" + +#include + +#include "Units.h" +#include "gfxPoint.h" +#include "mozilla/TimeStamp.h" +#include "mozilla/dom/APZTestDataBinding.h" +#include "mozilla/dom/ToJSValue.h" +#include "nsTArray.h" + +namespace mozilla { +namespace layers { + +using namespace gfx; + +Point +LayerTransforms::GetAverage() +{ + MOZ_ASSERT(!mTransforms.IsEmpty()); + + Point current = mTransforms[0]; + Point average; + size_t length = mTransforms.Length(); + + for (size_t i = 1; i < length; i++) { + Point nextTransform = mTransforms[i]; + Point movement = nextTransform - current; + average += Point(std::fabs(movement.x), std::fabs(movement.y)); + current = nextTransform; + } + + average = average / (float) length; + return average; +} + +Point +LayerTransforms::GetStdDev() +{ + Point average = GetAverage(); + Point stdDev; + Point current = mTransforms[0]; + + for (size_t i = 1; i < mTransforms.Length(); i++) { + Point next = mTransforms[i]; + Point move = next - current; + move.x = fabs(move.x); + move.y = fabs(move.y); + + Point diff = move - average; + diff.x = diff.x * diff.x; + diff.y = diff.y * diff.y; + stdDev += diff; + + current = next; + } + + stdDev = stdDev / mTransforms.Length(); + stdDev.x = sqrt(stdDev.x); + stdDev.y = sqrt(stdDev.y); + return stdDev; +} + +LayerTransformRecorder::~LayerTransformRecorder() +{ + Reset(); +} + +void +LayerTransformRecorder::RecordTransform(Layer* aLayer, const Point& aTransform) +{ + LayerTransforms* layerTransforms = GetLayerTransforms((uintptr_t) aLayer); + layerTransforms->mTransforms.AppendElement(aTransform); +} + +void +LayerTransformRecorder::EndTest(FrameUniformityData* aOutData) +{ + for (auto iter = mFrameTransforms.begin(); iter != mFrameTransforms.end(); ++iter) { + uintptr_t layer = iter->first; + float uniformity = CalculateFrameUniformity(layer); + + std::pair result(layer, uniformity); + aOutData->mUniformities.insert(result); + } + + Reset(); +} + +LayerTransforms* +LayerTransformRecorder::GetLayerTransforms(uintptr_t aLayer) +{ + if (!mFrameTransforms.count(aLayer)) { + LayerTransforms* newTransform = new LayerTransforms(); + std::pair newLayer(aLayer, newTransform); + mFrameTransforms.insert(newLayer); + } + + return mFrameTransforms.find(aLayer)->second; +} + +void +LayerTransformRecorder::Reset() +{ + for (auto iter = mFrameTransforms.begin(); iter != mFrameTransforms.end(); ++iter) { + LayerTransforms* layerTransforms = iter->second; + delete layerTransforms; + } + + mFrameTransforms.clear(); +} + +float +LayerTransformRecorder::CalculateFrameUniformity(uintptr_t aLayer) +{ + LayerTransforms* layerTransform = GetLayerTransforms(aLayer); + float yUniformity = -1; + if (!layerTransform->mTransforms.IsEmpty()) { + Point stdDev = layerTransform->GetStdDev(); + yUniformity = stdDev.y; + } + return yUniformity; +} + +bool +FrameUniformityData::ToJS(JS::MutableHandleValue aOutValue, JSContext* aContext) +{ + dom::FrameUniformityResults results; + dom::Sequence& layers = results.mLayerUniformities.Construct(); + + for (auto iter = mUniformities.begin(); iter != mUniformities.end(); ++iter) { + uintptr_t layerAddr = iter->first; + float uniformity = iter->second; + + layers.AppendElement(); + dom::FrameUniformity& entry = layers.LastElement(); + + entry.mLayerAddress.Construct() = layerAddr; + entry.mFrameUniformity.Construct() = uniformity; + } + + return dom::ToJSValue(aContext, results, aOutValue); +} + +} +} diff --git a/gfx/layers/composite/FrameUniformityData.h b/gfx/layers/composite/FrameUniformityData.h new file mode 100644 index 00000000000..35a155bf6ee --- /dev/null +++ b/gfx/layers/composite/FrameUniformityData.h @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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_layers_FrameUniformityData_h_ +#define mozilla_layers_FrameUniformityData_h_ + +#include "ipc/IPCMessageUtils.h" +#include "js/TypeDecls.h" +#include "nsRefPtr.h" + +namespace mozilla { +namespace layers { +class Layer; + +class FrameUniformityData { + friend struct IPC::ParamTraits; + +public: + bool ToJS(JS::MutableHandleValue aOutValue, JSContext* aContext); + // Contains the calculated frame uniformities + std::map mUniformities; +}; + +struct LayerTransforms { + LayerTransforms() {} + + gfx::Point GetAverage(); + gfx::Point GetStdDev(); + + // 60 fps * 5 seconds worth of data + nsAutoTArray mTransforms; +}; + +class LayerTransformRecorder { +public: + LayerTransformRecorder() {} + ~LayerTransformRecorder(); + + void RecordTransform(Layer* aLayer, const gfx::Point& aTransform); + void Reset(); + void EndTest(FrameUniformityData* aOutData); + +private: + float CalculateFrameUniformity(uintptr_t aLayer); + LayerTransforms* GetLayerTransforms(uintptr_t aLayer); + std::map mFrameTransforms; +}; + +} // mozilla +} // layers + +namespace IPC { +template<> +struct ParamTraits +{ + typedef mozilla::layers::FrameUniformityData paramType; + + static void Write(Message* aMsg, const paramType& aParam) + { + WriteParam(aMsg, aParam.mUniformities); + } + + static bool Read(const Message* aMsg, void** aIter, paramType* aResult) + { + return ParamTraitsStd>::Read(aMsg, aIter, &aResult->mUniformities); + } +}; + +}// ipc + +#endif // mozilla_layers_FrameUniformityData_h_ diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index b6a30843660..1b3e55459c7 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -37,6 +37,7 @@ #include "mozilla/layers/CompositorLRU.h" // for CompositorLRU #include "mozilla/layers/CompositorOGL.h" // for CompositorOGL #include "mozilla/layers/CompositorTypes.h" +#include "mozilla/layers/FrameUniformityData.h" #include "mozilla/layers/LayerManagerComposite.h" #include "mozilla/layers/LayersTypes.h" #include "mozilla/layers/PLayerTransactionParent.h" @@ -1324,6 +1325,13 @@ CompositorParent::ApplyAsyncProperties(LayerTransactionParent* aLayerTree) } } +bool +CompositorParent::RecvGetFrameUniformity(FrameUniformityData* aOutData) +{ + mCompositionManager->GetFrameUniformity(aOutData); + return true; +} + bool CompositorParent::RecvRequestOverfill() { @@ -1713,6 +1721,13 @@ public: return true; } + virtual bool RecvGetFrameUniformity(FrameUniformityData* aOutData) override + { + // Don't support calculating frame uniformity on the child process and + // this is just a stub for now. + MOZ_ASSERT(false); + return true; + } /** * Tells this CompositorParent to send a message when the compositor has received the transaction. diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h index b58f5f0d12b..4cbb156deb9 100644 --- a/gfx/layers/ipc/CompositorParent.h +++ b/gfx/layers/ipc/CompositorParent.h @@ -229,6 +229,7 @@ public: base::ProcessHandle aPeerProcess, mozilla::ipc::ProtocolCloneContext* aCtx) override; + virtual bool RecvGetFrameUniformity(FrameUniformityData* aOutData) override; virtual bool RecvRequestOverfill() override; virtual bool RecvWillStop() override; virtual bool RecvStop() override; diff --git a/gfx/layers/ipc/PCompositor.ipdl b/gfx/layers/ipc/PCompositor.ipdl index aa0a0807592..c89e88a97e1 100644 --- a/gfx/layers/ipc/PCompositor.ipdl +++ b/gfx/layers/ipc/PCompositor.ipdl @@ -19,6 +19,7 @@ using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h"; using mozilla::ipc::SharedMemoryBasic::Handle from "mozilla/ipc/SharedMemoryBasic.h"; using class mozilla::TimeStamp from "mozilla/TimeStamp.h"; +using class mozilla::layers::FrameUniformityData from "mozilla/layers/FrameUniformityData.h"; namespace mozilla { namespace layers { @@ -80,6 +81,9 @@ parent: // Child sends the parent a request for fill ratio numbers. async RequestOverfill(); + // Child requests frame uniformity measurements + sync GetFrameUniformity() returns (FrameUniformityData data); + // The child is about to be destroyed, so perform any necessary cleanup. sync WillStop(); diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index 57130a82b61..c32c0a5d8b7 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -125,6 +125,7 @@ EXPORTS.mozilla.layers += [ 'composite/ColorLayerComposite.h', 'composite/ContainerLayerComposite.h', 'composite/ContentHost.h', + 'composite/FrameUniformityData.h', 'composite/ImageHost.h', 'composite/ImageLayerComposite.h', 'composite/LayerManagerComposite.h', @@ -277,6 +278,7 @@ UNIFIED_SOURCES += [ 'composite/ContainerLayerComposite.cpp', 'composite/ContentHost.cpp', 'composite/FPSCounter.cpp', + 'composite/FrameUniformityData.cpp', 'composite/ImageHost.cpp', 'composite/ImageLayerComposite.cpp', 'composite/LayerManagerComposite.cpp', @@ -391,6 +393,7 @@ CXXFLAGS += [ ] MOCHITEST_MANIFESTS += ['apz/test/mochitest.ini'] +MOCHITEST_CHROME_MANIFESTS += ['apz/test/chrome.ini'] CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 64f01da05cf..38a95febd67 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -240,6 +240,7 @@ private: DECL_GFX_PREF(Once, "gfx.touch.resample.old-touch-threshold",TouchResampleOldTouchThreshold, int32_t, 17); DECL_GFX_PREF(Once, "gfx.touch.resample.vsync-adjust", TouchVsyncSampleAdjust, int32_t, 5); + DECL_GFX_PREF(Live, "gfx.vsync.collect-scroll-transforms", CollectScrollTransforms, bool, false); DECL_GFX_PREF(Once, "gfx.vsync.compositor", VsyncAlignedCompositor, bool, false); // On b2g, in really bad cases, I've seen up to 80 ms delays between touch events and the main thread // processing them. So 80 ms / 16 = 5 vsync events. Double it up just to be on the safe side, so 10.