summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RegionSamplingThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
-rw-r--r--services/surfaceflinger/RegionSamplingThread.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp
index c77bcfa6ed..06c2f26a6d 100644
--- a/services/surfaceflinger/RegionSamplingThread.cpp
+++ b/services/surfaceflinger/RegionSamplingThread.cpp
@@ -26,6 +26,7 @@
#include "RegionSamplingThread.h"
+#include <common/trace.h>
#include <compositionengine/Display.h>
#include <compositionengine/impl/OutputCompositionState.h>
#include <cutils/properties.h>
@@ -34,7 +35,6 @@
#include <gui/SyncScreenCaptureListener.h>
#include <renderengine/impl/ExternalTexture.h>
#include <ui/DisplayStatInfo.h>
-#include <utils/Trace.h>
#include <string>
@@ -148,7 +148,7 @@ void RegionSamplingThread::checkForStaleLuma() {
std::lock_guard lock(mThreadControlMutex);
if (mSampleRequestTime.has_value()) {
- ATRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::waitForSamplePhase));
+ SFTRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::waitForSamplePhase));
mSampleRequestTime.reset();
mFlinger.scheduleSample();
}
@@ -166,7 +166,7 @@ void RegionSamplingThread::doSample(
if (mLastSampleTime + mTunables.mSamplingPeriod > now) {
// content changed, but we sampled not too long ago, so we need to sample some time in the
// future.
- ATRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::idleTimerWaiting));
+ SFTRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::idleTimerWaiting));
mSampleRequestTime = now;
return;
}
@@ -175,13 +175,13 @@ void RegionSamplingThread::doSample(
// until the next vsync deadline, defer this sampling work
// to a later frame, when hopefully there will be more time.
if (samplingDeadline.has_value() && now + mTunables.mSamplingDuration > *samplingDeadline) {
- ATRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::waitForQuietFrame));
+ SFTRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::waitForQuietFrame));
mSampleRequestTime = mSampleRequestTime.value_or(now);
return;
}
}
- ATRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::sample));
+ SFTRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::sample));
mSampleRequestTime.reset();
mLastSampleTime = now;
@@ -247,7 +247,7 @@ std::vector<float> RegionSamplingThread::sampleBuffer(
}
void RegionSamplingThread::captureSample() {
- ATRACE_CALL();
+ SFTRACE_CALL();
std::lock_guard lock(mSamplingMutex);
if (mDescriptors.empty()) {
@@ -346,6 +346,7 @@ void RegionSamplingThread::captureSample() {
constexpr bool kRegionSampling = true;
constexpr bool kGrayscale = false;
constexpr bool kIsProtected = false;
+ constexpr bool kAttachGainmap = false;
SurfaceFlinger::RenderAreaBuilderVariant
renderAreaBuilder(std::in_place_type<DisplayRenderAreaBuilder>, sampledBounds,
@@ -356,18 +357,17 @@ void RegionSamplingThread::captureSample() {
if (FlagManager::getInstance().single_hop_screenshot() &&
FlagManager::getInstance().ce_fence_promise() && mFlinger.mRenderEngine->isThreaded()) {
std::vector<sp<LayerFE>> layerFEs;
- auto displayState =
- mFlinger.getDisplayAndLayerSnapshotsFromMainThread(renderAreaBuilder,
- getLayerSnapshotsFn, layerFEs);
- fenceResult =
- mFlinger.captureScreenshot(renderAreaBuilder, buffer, kRegionSampling, kGrayscale,
- kIsProtected, nullptr, displayState, layerFEs)
- .get();
+ auto displayState = mFlinger.getSnapshotsFromMainThread(renderAreaBuilder,
+ getLayerSnapshotsFn, layerFEs);
+ fenceResult = mFlinger.captureScreenshot(renderAreaBuilder, buffer, kRegionSampling,
+ kGrayscale, kIsProtected, kAttachGainmap, nullptr,
+ displayState, layerFEs)
+ .get();
} else {
- fenceResult =
- mFlinger.captureScreenshotLegacy(renderAreaBuilder, getLayerSnapshotsFn, buffer,
- kRegionSampling, kGrayscale, kIsProtected, nullptr)
- .get();
+ fenceResult = mFlinger.captureScreenshotLegacy(renderAreaBuilder, getLayerSnapshotsFn,
+ buffer, kRegionSampling, kGrayscale,
+ kIsProtected, kAttachGainmap, nullptr)
+ .get();
}
if (fenceResult.ok()) {
fenceResult.value()->waitForever(LOG_TAG);
@@ -394,7 +394,7 @@ void RegionSamplingThread::captureSample() {
}
mCachedBuffer = buffer;
- ATRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::noWorkNeeded));
+ SFTRACE_INT(lumaSamplingStepTag, static_cast<int>(samplingStep::noWorkNeeded));
}
// NO_THREAD_SAFETY_ANALYSIS is because std::unique_lock presently lacks thread safety annotations.