diff options
author | 2023-01-27 16:52:40 -0600 | |
---|---|---|
committer | 2023-01-31 11:20:24 -0600 | |
commit | 278a88f603fbdbc46275dc67463b796a22e71353 (patch) | |
tree | a9cb05e2d3f73b09ff9b9978c90c07bea28e06b3 /services/surfaceflinger/ScreenCaptureOutput.cpp | |
parent | 3fee9b9b32e599e6a71a43a5f6a6295c282649b1 (diff) |
SF: clean up texture filtering logic
* Removes redundant logic for determining whether or not SurfaceFlinger should request texture filtering.
* Fixes an issue where ScreenCaptureOutput was using incorrect values for its layer stack projection space.
Bug: 238348307
Test: atest TextureFilteringTest
Change-Id: I4ece87321ee73d10b86a2c01d53717d337c11926
Diffstat (limited to 'services/surfaceflinger/ScreenCaptureOutput.cpp')
-rw-r--r-- | services/surfaceflinger/ScreenCaptureOutput.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/services/surfaceflinger/ScreenCaptureOutput.cpp b/services/surfaceflinger/ScreenCaptureOutput.cpp index 6d195b9f7b..a1d5cd7379 100644 --- a/services/surfaceflinger/ScreenCaptureOutput.cpp +++ b/services/surfaceflinger/ScreenCaptureOutput.cpp @@ -27,11 +27,8 @@ namespace android { std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutputArgs args) { std::shared_ptr<ScreenCaptureOutput> output = compositionengine::impl::createOutputTemplated< ScreenCaptureOutput, compositionengine::CompositionEngine, const RenderArea&, - std::unordered_set<compositionengine::LayerFE*>, const compositionengine::Output::ColorProfile&, bool>(args.compositionEngine, args.renderArea, - std::move( - args.filterForScreenshot), args.colorProfile, args.regionSampling); output->editState().isSecure = args.renderArea.isSecure(); @@ -45,12 +42,11 @@ std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutp .setHasWideColorGamut(true) .Build())); - ui::Rotation orientation = ui::Transform::toRotation(args.renderArea.getRotationFlags()); - Rect orientedDisplaySpaceRect{args.renderArea.getReqWidth(), args.renderArea.getReqHeight()}; - output->setProjection(orientation, args.renderArea.getLayerStackSpaceRect(), - orientedDisplaySpaceRect); - - Rect sourceCrop = args.renderArea.getSourceCrop(); + const Rect& sourceCrop = args.renderArea.getSourceCrop(); + const ui::Rotation orientation = ui::Transform::toRotation(args.renderArea.getRotationFlags()); + const Rect orientedDisplaySpaceRect{args.renderArea.getReqWidth(), + args.renderArea.getReqHeight()}; + output->setProjection(orientation, sourceCrop, orientedDisplaySpaceRect); output->setDisplaySize({sourceCrop.getWidth(), sourceCrop.getHeight()}); { @@ -64,13 +60,9 @@ std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutp } ScreenCaptureOutput::ScreenCaptureOutput( - const RenderArea& renderArea, - std::unordered_set<compositionengine::LayerFE*> filterForScreenshot, - const compositionengine::Output::ColorProfile& colorProfile, bool regionSampling) - : mRenderArea(renderArea), - mFilterForScreenshot(std::move(filterForScreenshot)), - mColorProfile(colorProfile), - mRegionSampling(regionSampling) {} + const RenderArea& renderArea, const compositionengine::Output::ColorProfile& colorProfile, + bool regionSampling) + : mRenderArea(renderArea), mColorProfile(colorProfile), mRegionSampling(regionSampling) {} void ScreenCaptureOutput::updateColorProfile(const compositionengine::CompositionRefreshArgs&) { auto& outputState = editState(); @@ -115,9 +107,4 @@ ScreenCaptureOutput::generateClientCompositionRequests( return clientCompositionLayers; } -bool ScreenCaptureOutput::layerNeedsFiltering(const compositionengine::OutputLayer* layer) const { - return mRenderArea.needsFiltering() || - mFilterForScreenshot.find(&layer->getLayerFE()) != mFilterForScreenshot.end(); -} - } // namespace android |