diff options
author | Yiwei Zhang <zzyiwei@google.com> | 2018-08-22 13:59:12 -0700 |
---|---|---|
committer | Yiwei Zhang <zzyiwei@google.com> | 2018-08-22 14:40:26 -0700 |
commit | cf39b7bcad8c4d099b29ad42c6d524837fe3b2ea (patch) | |
tree | 2b2d7df47ea8a6f1865686856f03c31d74c8b321 | |
parent | e06ad77bdd446ed2768b16a56179f97a0e3da043 (diff) | |
download | native-cf39b7bcad8c4d099b29ad42c6d524837fe3b2ea.tar.gz |
DO NOT MERGE Apply scissor in render engine for main display
Bug: b/113041377
Test: manually
Change-Id: I651357d456f13ff67961b75d3630aca91aa512ac
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 58dfc82066..28b447f7aa 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3060,22 +3060,17 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& displayDev } } - if (displayDevice->getDisplayType() != DisplayDevice::DISPLAY_PRIMARY) { - // just to be on the safe side, we don't set the - // scissor on the main display. It should never be needed - // anyways (though in theory it could since the API allows it). - const Rect& bounds(displayDevice->getBounds()); - const Rect& scissor(displayDevice->getScissor()); - if (scissor != bounds) { - // scissor doesn't match the screen's dimensions, so we - // need to clear everything outside of it and enable - // the GL scissor so we don't draw anything where we shouldn't - - // enable scissor for this frame - const uint32_t height = displayDevice->getHeight(); - getBE().mRenderEngine->setScissor(scissor.left, height - scissor.bottom, - scissor.getWidth(), scissor.getHeight()); - } + const Rect& bounds(displayDevice->getBounds()); + const Rect& scissor(displayDevice->getScissor()); + if (scissor != bounds) { + // scissor doesn't match the screen's dimensions, so we + // need to clear everything outside of it and enable + // the GL scissor so we don't draw anything where we shouldn't + + // enable scissor for this frame + const uint32_t height = displayDevice->getHeight(); + getBE().mRenderEngine->setScissor(scissor.left, height - scissor.bottom, + scissor.getWidth(), scissor.getHeight()); } } |