Added new arguments for screenshot request
Added frameScaleX and frameScaleY to replace frameScale to allow callers
to specify an X and Y scale separately.
Added grayscale flag to allow the caller to take the screenshot
in grayscale.
Test: ScreenCaptureTest.CaptureWithGrayscale
Bug: 155825630
Change-Id: Iea043b7074707df897d80bf057d7cc3870afad89
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 50d6099..dc92f98 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -810,13 +810,14 @@
void startBootAnim();
status_t captureScreenCommon(RenderAreaFuture, TraverseLayersFunction, ui::Size bufferSize,
- ui::PixelFormat, const bool allowProtected,
+ ui::PixelFormat, bool allowProtected, bool grayscale,
const sp<IScreenCaptureListener>&);
status_t captureScreenCommon(RenderAreaFuture, TraverseLayersFunction, sp<GraphicBuffer>&,
- bool regionSampling, const sp<IScreenCaptureListener>&);
+ bool regionSampling, bool grayscale,
+ const sp<IScreenCaptureListener>&);
status_t renderScreenImplLocked(const RenderArea&, TraverseLayersFunction,
const sp<GraphicBuffer>&, bool forSystem, bool regionSampling,
- ScreenCaptureResults&);
+ bool grayscale, ScreenCaptureResults&);
sp<DisplayDevice> getDisplayByIdOrLayerStack(uint64_t displayOrLayerStack) REQUIRES(mStateLock);
sp<DisplayDevice> getDisplayByLayerStack(uint64_t layerStack) REQUIRES(mStateLock);
@@ -1019,6 +1020,8 @@
void onFrameRateFlexibilityTokenReleased();
+ static mat4 calculateColorMatrix(float saturation);
+
void updateColorMatrixLocked();
// Verify that transaction is being called by an approved process: