зеркало из https://github.com/mozilla/gecko-dev.git
Bug 961289 - Compositor-side instances of APZ test data and utilities for writing to them r=BenWa,kats
--HG-- extra : source : 35f0767449046b88581ada14b9ea7fb0fdd819ac
This commit is contained in:
Родитель
23c2012d1e
Коммит
c841da8c4a
|
@ -98,7 +98,7 @@ void
|
||||||
APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
Layer* aRoot,
|
Layer* aRoot,
|
||||||
bool aIsFirstPaint,
|
bool aIsFirstPaint,
|
||||||
uint64_t aFirstPaintLayersId,
|
uint64_t aOriginatingLayersId,
|
||||||
uint32_t aPaintSequenceNumber)
|
uint32_t aPaintSequenceNumber)
|
||||||
{
|
{
|
||||||
if (AsyncPanZoomController::GetThreadAssertionsEnabled()) {
|
if (AsyncPanZoomController::GetThreadAssertionsEnabled()) {
|
||||||
|
@ -123,6 +123,15 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
Collect(mRootApzc, &apzcsToDestroy);
|
Collect(mRootApzc, &apzcsToDestroy);
|
||||||
mRootApzc = nullptr;
|
mRootApzc = nullptr;
|
||||||
|
|
||||||
|
// For testing purposes, we log some data to the APZTestData associated with
|
||||||
|
// the layers id that originated this update.
|
||||||
|
APZTestData* testData = nullptr;
|
||||||
|
if (CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(aOriginatingLayersId)) {
|
||||||
|
testData = &state->mApzTestData;
|
||||||
|
testData->StartNewPaint(aPaintSequenceNumber);
|
||||||
|
}
|
||||||
|
APZPaintLogHelper paintLogger(testData, aPaintSequenceNumber);
|
||||||
|
|
||||||
if (aRoot) {
|
if (aRoot) {
|
||||||
mApzcTreeLog << "[start]\n";
|
mApzcTreeLog << "[start]\n";
|
||||||
UpdatePanZoomControllerTree(aCompositor,
|
UpdatePanZoomControllerTree(aCompositor,
|
||||||
|
@ -130,8 +139,8 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
// aCompositor is null in gtest scenarios
|
// aCompositor is null in gtest scenarios
|
||||||
aCompositor ? aCompositor->RootLayerTreeId() : 0,
|
aCompositor ? aCompositor->RootLayerTreeId() : 0,
|
||||||
gfx3DMatrix(), nullptr, nullptr,
|
gfx3DMatrix(), nullptr, nullptr,
|
||||||
aIsFirstPaint, aFirstPaintLayersId,
|
aIsFirstPaint, aOriginatingLayersId,
|
||||||
&apzcsToDestroy);
|
paintLogger, &apzcsToDestroy);
|
||||||
mApzcTreeLog << "[end]\n";
|
mApzcTreeLog << "[end]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +157,8 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
AsyncPanZoomController* aParent,
|
AsyncPanZoomController* aParent,
|
||||||
AsyncPanZoomController* aNextSibling,
|
AsyncPanZoomController* aNextSibling,
|
||||||
bool aIsFirstPaint,
|
bool aIsFirstPaint,
|
||||||
uint64_t aFirstPaintLayersId,
|
uint64_t aOriginatingLayersId,
|
||||||
|
const APZPaintLogHelper& aPaintLogger,
|
||||||
nsTArray< nsRefPtr<AsyncPanZoomController> >* aApzcsToDestroy)
|
nsTArray< nsRefPtr<AsyncPanZoomController> >* aApzcsToDestroy)
|
||||||
{
|
{
|
||||||
mTreeLock.AssertCurrentThreadOwns();
|
mTreeLock.AssertCurrentThreadOwns();
|
||||||
|
@ -216,7 +226,7 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
APZC_LOG("Using APZC %p for layer %p with identifiers %lld %lld\n", apzc, aLayer, aLayersId, container->GetFrameMetrics().GetScrollId());
|
APZC_LOG("Using APZC %p for layer %p with identifiers %lld %lld\n", apzc, aLayer, aLayersId, container->GetFrameMetrics().GetScrollId());
|
||||||
|
|
||||||
apzc->NotifyLayersUpdated(metrics,
|
apzc->NotifyLayersUpdated(metrics,
|
||||||
aIsFirstPaint && (aLayersId == aFirstPaintLayersId));
|
aIsFirstPaint && (aLayersId == aOriginatingLayersId));
|
||||||
apzc->SetScrollHandoffParentId(container->GetScrollHandoffParentId());
|
apzc->SetScrollHandoffParentId(container->GetScrollHandoffParentId());
|
||||||
|
|
||||||
// Use the composition bounds as the hit test region.
|
// Use the composition bounds as the hit test region.
|
||||||
|
@ -302,8 +312,8 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
for (Layer* child = aLayer->GetLastChild(); child; child = child->GetPrevSibling()) {
|
for (Layer* child = aLayer->GetLastChild(); child; child = child->GetPrevSibling()) {
|
||||||
gfx::TreeAutoIndent indent(mApzcTreeLog);
|
gfx::TreeAutoIndent indent(mApzcTreeLog);
|
||||||
next = UpdatePanZoomControllerTree(aCompositor, child, childLayersId, aTransform, aParent, next,
|
next = UpdatePanZoomControllerTree(aCompositor, child, childLayersId, aTransform, aParent, next,
|
||||||
aIsFirstPaint, aFirstPaintLayersId,
|
aIsFirstPaint, aOriginatingLayersId,
|
||||||
aPaintSequenceNumber, aApzcsToDestroy);
|
aPaintLogger, aApzcsToDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the APZC that should be the sibling of other APZCs as we continue
|
// Return the APZC that should be the sibling of other APZCs as we continue
|
||||||
|
|
|
@ -40,6 +40,7 @@ enum AllowedTouchBehavior {
|
||||||
class Layer;
|
class Layer;
|
||||||
class AsyncPanZoomController;
|
class AsyncPanZoomController;
|
||||||
class CompositorParent;
|
class CompositorParent;
|
||||||
|
class APZPaintLogHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ****************** NOTE ON LOCK ORDERING IN APZ **************************
|
* ****************** NOTE ON LOCK ORDERING IN APZ **************************
|
||||||
|
@ -112,7 +113,7 @@ public:
|
||||||
void UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
void UpdatePanZoomControllerTree(CompositorParent* aCompositor,
|
||||||
Layer* aRoot,
|
Layer* aRoot,
|
||||||
bool aIsFirstPaint,
|
bool aIsFirstPaint,
|
||||||
uint64_t aFirstPaintLayersId,
|
uint64_t aOriginatingLayersId,
|
||||||
uint32_t aPaintSequenceNumber);
|
uint32_t aPaintSequenceNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -335,7 +336,8 @@ private:
|
||||||
AsyncPanZoomController* aParent,
|
AsyncPanZoomController* aParent,
|
||||||
AsyncPanZoomController* aNextSibling,
|
AsyncPanZoomController* aNextSibling,
|
||||||
bool aIsFirstPaint,
|
bool aIsFirstPaint,
|
||||||
uint64_t aFirstPaintLayersId,
|
uint64_t aOriginatingLayersId,
|
||||||
|
const APZPaintLogHelper& aPaintLogger,
|
||||||
nsTArray< nsRefPtr<AsyncPanZoomController> >* aApzcsToDestroy);
|
nsTArray< nsRefPtr<AsyncPanZoomController> >* aApzcsToDestroy);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "nsDebug.h" // for NS_WARNING
|
#include "nsDebug.h" // for NS_WARNING
|
||||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT
|
||||||
#include "mozilla/DebugOnly.h" // for DebugOnly
|
#include "mozilla/DebugOnly.h" // for DebugOnly
|
||||||
|
#include "mozilla/ToString.h" // for ToString
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
@ -98,6 +99,35 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// A helper class for logging data for a paint.
|
||||||
|
class APZPaintLogHelper {
|
||||||
|
public:
|
||||||
|
APZPaintLogHelper(APZTestData* aTestData, SequenceNumber aPaintSequenceNumber)
|
||||||
|
: mTestData(aTestData),
|
||||||
|
mPaintSequenceNumber(aPaintSequenceNumber)
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <typename Value>
|
||||||
|
void LogTestData(FrameMetrics::ViewID aScrollId,
|
||||||
|
const std::string& aKey,
|
||||||
|
const Value& aValue) const {
|
||||||
|
if (mTestData) { // avoid stringifying if mTestData == nullptr
|
||||||
|
LogTestData(aScrollId, aKey, ToString(aValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogTestData(FrameMetrics::ViewID aScrollId,
|
||||||
|
const std::string& aKey,
|
||||||
|
const std::string& aValue) const {
|
||||||
|
if (mTestData) {
|
||||||
|
mTestData->LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey, aValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
APZTestData* mTestData;
|
||||||
|
SequenceNumber mPaintSequenceNumber;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1212,10 +1212,10 @@ UpdateIndirectTree(uint64_t aId, Layer* aRoot, const TargetConfig& aTargetConfig
|
||||||
sIndirectLayerTrees[aId].mTargetConfig = aTargetConfig;
|
sIndirectLayerTrees[aId].mTargetConfig = aTargetConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ const CompositorParent::LayerTreeState*
|
/* static */ CompositorParent::LayerTreeState*
|
||||||
CompositorParent::GetIndirectShadowTree(uint64_t aId)
|
CompositorParent::GetIndirectShadowTree(uint64_t aId)
|
||||||
{
|
{
|
||||||
LayerTreeMap::const_iterator cit = sIndirectLayerTrees.find(aId);
|
LayerTreeMap::iterator cit = sIndirectLayerTrees.find(aId);
|
||||||
if (sIndirectLayerTrees.end() == cit) {
|
if (sIndirectLayerTrees.end() == cit) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "mozilla/layers/GeckoContentController.h"
|
#include "mozilla/layers/GeckoContentController.h"
|
||||||
#include "mozilla/layers/LayersMessages.h" // for TargetConfig
|
#include "mozilla/layers/LayersMessages.h" // for TargetConfig
|
||||||
#include "mozilla/layers/PCompositorParent.h"
|
#include "mozilla/layers/PCompositorParent.h"
|
||||||
|
#include "mozilla/layers/APZTestData.h"
|
||||||
#include "nsAutoPtr.h" // for nsRefPtr
|
#include "nsAutoPtr.h" // for nsRefPtr
|
||||||
#include "nsISupportsImpl.h"
|
#include "nsISupportsImpl.h"
|
||||||
#include "nsSize.h" // for nsIntSize
|
#include "nsSize.h" // for nsIntSize
|
||||||
|
@ -222,6 +223,7 @@ public:
|
||||||
// the PCompositorChild
|
// the PCompositorChild
|
||||||
PCompositorParent* mCrossProcessParent;
|
PCompositorParent* mCrossProcessParent;
|
||||||
TargetConfig mTargetConfig;
|
TargetConfig mTargetConfig;
|
||||||
|
APZTestData mApzTestData;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -229,7 +231,7 @@ public:
|
||||||
* exists. Otherwise null is returned. This must only be called on
|
* exists. Otherwise null is returned. This must only be called on
|
||||||
* the compositor thread.
|
* the compositor thread.
|
||||||
*/
|
*/
|
||||||
static const LayerTreeState* GetIndirectShadowTree(uint64_t aId);
|
static LayerTreeState* GetIndirectShadowTree(uint64_t aId);
|
||||||
|
|
||||||
float ComputeRenderIntegrity();
|
float ComputeRenderIntegrity();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче