Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f50c4b5e authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Steve Kondik
Browse files

Support forcing all screenshots into a CPU consumer

Looks like a full GPU path is less efficient on some GPU
drivers that we're still using, and CPU is reliably faster...
(there's probably a locking condition going on somewhere, this
needs to be looked into)

Change-Id: I8878796a117d65bf2324507cf8755cadce49f6dc
parent 6882c909
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@ ifeq ($(TARGET_NO_SENSOR_PERMISSION_CHECK),true)
LOCAL_CPPFLAGS += -DNO_SENSOR_PERMISSION_CHECK
endif

ifeq ($(TARGET_FORCE_SCREENSHOT_CPU_PATH),true)
LOCAL_CPPFLAGS += -DFORCE_SCREENSHOT_CPU_PATH
endif

include $(BUILD_SHARED_LIBRARY)

ifeq (,$(ONE_SHOT_MAKEFILE))
+7 −1
Original line number Diff line number Diff line
@@ -873,6 +873,12 @@ status_t SurfaceComposerClient::getHdrCapabilities(const sp<IBinder>& display,

// ----------------------------------------------------------------------------

#ifndef FORCE_SCREENSHOT_CPU_PATH
#define SS_CPU_CONSUMER false
#else
#define SS_CPU_CONSUMER true
#endif

status_t ScreenshotClient::capture(
        const sp<IBinder>& display,
        const sp<IGraphicBufferProducer>& producer,
@@ -882,7 +888,7 @@ status_t ScreenshotClient::capture(
    if (s == NULL) return NO_INIT;
    return s->captureScreen(display, producer, sourceCrop,
            reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform,
            ISurfaceComposer::eRotateNone, false);
            ISurfaceComposer::eRotateNone, SS_CPU_CONSUMER);
}

ScreenshotClient::ScreenshotClient()