Merge "Call Layer::getLayerDebugInfo from the main thread" into rvc-dev am: 32ca5feb99
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/11760023 Change-Id: Ia0d1652beeecc5d5c60e65fe9f4241b3f5b7a757
This commit is contained in:
commit
4225e7f1d5
6 changed files with 12 additions and 16 deletions
|
@ -691,8 +691,7 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const
|
||||
{
|
||||
virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) {
|
||||
if (!outLayers) {
|
||||
return UNEXPECTED_NULL;
|
||||
}
|
||||
|
|
|
@ -354,7 +354,7 @@ public:
|
|||
*
|
||||
* Requires the ACCESS_SURFACE_FLINGER permission.
|
||||
*/
|
||||
virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const = 0;
|
||||
virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) = 0;
|
||||
|
||||
virtual status_t getColorManagement(bool* outGetColorManagement) const = 0;
|
||||
|
||||
|
|
|
@ -785,7 +785,7 @@ public:
|
|||
return NO_ERROR;
|
||||
}
|
||||
status_t injectVSync(nsecs_t /*when*/) override { return NO_ERROR; }
|
||||
status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* /*layers*/) const override {
|
||||
status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* /*layers*/) override {
|
||||
return NO_ERROR;
|
||||
}
|
||||
status_t getCompositionPreference(
|
||||
|
|
|
@ -1501,7 +1501,7 @@ LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const {
|
|||
LayerDebugInfo info;
|
||||
const State& ds = getDrawingState();
|
||||
info.mName = getName();
|
||||
sp<Layer> parent = getParent();
|
||||
sp<Layer> parent = mDrawingParent.promote();
|
||||
info.mParentName = parent ? parent->getName() : "none"s;
|
||||
info.mType = getType();
|
||||
info.mTransparentRegion = ds.activeTransparentRegion_legacy;
|
||||
|
|
|
@ -1449,17 +1449,14 @@ status_t SurfaceFlinger::injectVSync(nsecs_t when) {
|
|||
return mScheduler->injectVSync(when, calculateExpectedPresentTime(when)) ? NO_ERROR : BAD_VALUE;
|
||||
}
|
||||
|
||||
status_t SurfaceFlinger::getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const {
|
||||
TimedLock lock(mStateLock, s2ns(1), __FUNCTION__);
|
||||
if (!lock.locked()) {
|
||||
return TIMED_OUT;
|
||||
}
|
||||
|
||||
const auto display = getDefaultDisplayDeviceLocked();
|
||||
status_t SurfaceFlinger::getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) {
|
||||
outLayers->clear();
|
||||
mCurrentState.traverseInZOrder(
|
||||
[&](Layer* layer) { outLayers->push_back(layer->getLayerDebugInfo(display.get())); });
|
||||
|
||||
schedule([=] {
|
||||
const auto display = ON_MAIN_THREAD(getDefaultDisplayDeviceLocked());
|
||||
mDrawingState.traverseInZOrder([&](Layer* layer) {
|
||||
outLayers->push_back(layer->getLayerDebugInfo(display.get()));
|
||||
});
|
||||
}).wait();
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -466,7 +466,7 @@ private:
|
|||
HdrCapabilities* outCapabilities) const override;
|
||||
status_t enableVSyncInjections(bool enable) override;
|
||||
status_t injectVSync(nsecs_t when) override;
|
||||
status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const override;
|
||||
status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) override;
|
||||
status_t getColorManagement(bool* outGetColorManagement) const override;
|
||||
status_t getCompositionPreference(ui::Dataspace* outDataspace, ui::PixelFormat* outPixelFormat,
|
||||
ui::Dataspace* outWideColorGamutDataspace,
|
||||
|
|
Loading…
Reference in a new issue