Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,8 @@ status_t HWComposer::prepare(DisplayDevice& display, validateChange(compositionInfo.compositionType, changedTypes[&*hwcLayer]); compositionInfo.compositionType = changedTypes[&*hwcLayer]; compositionInfo.layer->mLayer->setCompositionType(displayId, compositionInfo.compositionType, false); } switch (compositionInfo.compositionType) { Loading @@ -520,6 +522,7 @@ status_t HWComposer::prepare(DisplayDevice& display, layerRequests[&*hwcLayer] == HWC2::LayerRequest::ClearClientTarget) { compositionInfo.hwc.clearClientTarget = true; compositionInfo.layer->mLayer->setClearClientTarget(displayId, true); } else { if (layerRequests.count(&*hwcLayer) != 0) { LOG_DISPLAY_ERROR(displayId, Loading @@ -527,6 +530,7 @@ status_t HWComposer::prepare(DisplayDevice& display, .c_str()); } compositionInfo.hwc.clearClientTarget = false; compositionInfo.layer->mLayer->setClearClientTarget(displayId, false); } } Loading services/surfaceflinger/Layer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,10 @@ void Layer::clearWithOpenGL(const RenderArea& renderArea, float red, float green engine.drawMesh(getBE().mMesh); } void Layer::clearWithOpenGL(const RenderArea& renderArea) const { clearWithOpenGL(renderArea, 0, 0, 0, 0); } void Layer::setCompositionType(int32_t displayId, HWC2::Composition type, bool /*callIntoHwc*/) { if (getBE().mHwcLayers.count(displayId) == 0) { ALOGE("setCompositionType called without a valid HWC layer"); Loading services/surfaceflinger/Layer.h +1 −0 Original line number Diff line number Diff line Loading @@ -503,6 +503,7 @@ public: } // ----------------------------------------------------------------------- void clearWithOpenGL(const RenderArea& renderArea) const; inline const State& getDrawingState() const { return mDrawingState; } inline const State& getCurrentState() const { return mCurrentState; } Loading services/surfaceflinger/LayerBE.h +1 −1 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ public: void clear(renderengine::RenderEngine& renderEngine); renderengine::Mesh& getMesh() { return mMesh; } private: Layer*const mLayer; private: // The mesh used to draw the layer in GLES composition mode renderengine::Mesh mMesh; Loading services/surfaceflinger/SurfaceFlinger.cpp +11 −12 Original line number Diff line number Diff line Loading @@ -3218,30 +3218,29 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& display) { ALOGV("Rendering client layers"); const ui::Transform& displayTransform = display->getTransform(); bool firstLayer = true; for (auto& compositionInfo : getBE().mCompositionInfo[displayId]) { const Region bounds(display->bounds()); for (auto& layer : display->getVisibleLayersSortedByZ()) { const Region clip(bounds.intersect( displayTransform.transform(compositionInfo.layer->mLayer->visibleRegion))); ALOGV("Layer: %s", compositionInfo.layerName.c_str()); displayTransform.transform(layer->visibleRegion))); ALOGV("Layer: %s", layer->getName().string()); ALOGV(" Composition type: %s", to_string(layer->getCompositionType(displayId)).c_str()); if (!clip.isEmpty()) { switch (compositionInfo.compositionType) { switch (layer->getCompositionType(displayId)) { case HWC2::Composition::Cursor: case HWC2::Composition::Device: case HWC2::Composition::Sideband: case HWC2::Composition::SolidColor: { const Layer::State& state(compositionInfo.layer->mLayer->getDrawingState()); const bool opaque = compositionInfo.layer->mLayer->isOpaque(state) && compositionInfo.layer->mLayer->getAlpha() == 1.0f; if (compositionInfo.hwc.clearClientTarget && !firstLayer && opaque && const Layer::State& state(layer->getDrawingState()); if (layer->getClearClientTarget(displayId) && !firstLayer && layer->isOpaque(state) && (layer->getAlpha() == 1.0f) && hasClientComposition) { // never clear the very first layer since we're // guaranteed the FB is already cleared compositionInfo.layer->clear(getRenderEngine()); layer->clearWithOpenGL(renderArea); } break; } case HWC2::Composition::Client: { compositionInfo.layer->mLayer->draw(renderArea, clip); layer->draw(renderArea, clip); break; } default: Loading Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,8 @@ status_t HWComposer::prepare(DisplayDevice& display, validateChange(compositionInfo.compositionType, changedTypes[&*hwcLayer]); compositionInfo.compositionType = changedTypes[&*hwcLayer]; compositionInfo.layer->mLayer->setCompositionType(displayId, compositionInfo.compositionType, false); } switch (compositionInfo.compositionType) { Loading @@ -520,6 +522,7 @@ status_t HWComposer::prepare(DisplayDevice& display, layerRequests[&*hwcLayer] == HWC2::LayerRequest::ClearClientTarget) { compositionInfo.hwc.clearClientTarget = true; compositionInfo.layer->mLayer->setClearClientTarget(displayId, true); } else { if (layerRequests.count(&*hwcLayer) != 0) { LOG_DISPLAY_ERROR(displayId, Loading @@ -527,6 +530,7 @@ status_t HWComposer::prepare(DisplayDevice& display, .c_str()); } compositionInfo.hwc.clearClientTarget = false; compositionInfo.layer->mLayer->setClearClientTarget(displayId, false); } } Loading
services/surfaceflinger/Layer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,10 @@ void Layer::clearWithOpenGL(const RenderArea& renderArea, float red, float green engine.drawMesh(getBE().mMesh); } void Layer::clearWithOpenGL(const RenderArea& renderArea) const { clearWithOpenGL(renderArea, 0, 0, 0, 0); } void Layer::setCompositionType(int32_t displayId, HWC2::Composition type, bool /*callIntoHwc*/) { if (getBE().mHwcLayers.count(displayId) == 0) { ALOGE("setCompositionType called without a valid HWC layer"); Loading
services/surfaceflinger/Layer.h +1 −0 Original line number Diff line number Diff line Loading @@ -503,6 +503,7 @@ public: } // ----------------------------------------------------------------------- void clearWithOpenGL(const RenderArea& renderArea) const; inline const State& getDrawingState() const { return mDrawingState; } inline const State& getCurrentState() const { return mCurrentState; } Loading
services/surfaceflinger/LayerBE.h +1 −1 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ public: void clear(renderengine::RenderEngine& renderEngine); renderengine::Mesh& getMesh() { return mMesh; } private: Layer*const mLayer; private: // The mesh used to draw the layer in GLES composition mode renderengine::Mesh mMesh; Loading
services/surfaceflinger/SurfaceFlinger.cpp +11 −12 Original line number Diff line number Diff line Loading @@ -3218,30 +3218,29 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& display) { ALOGV("Rendering client layers"); const ui::Transform& displayTransform = display->getTransform(); bool firstLayer = true; for (auto& compositionInfo : getBE().mCompositionInfo[displayId]) { const Region bounds(display->bounds()); for (auto& layer : display->getVisibleLayersSortedByZ()) { const Region clip(bounds.intersect( displayTransform.transform(compositionInfo.layer->mLayer->visibleRegion))); ALOGV("Layer: %s", compositionInfo.layerName.c_str()); displayTransform.transform(layer->visibleRegion))); ALOGV("Layer: %s", layer->getName().string()); ALOGV(" Composition type: %s", to_string(layer->getCompositionType(displayId)).c_str()); if (!clip.isEmpty()) { switch (compositionInfo.compositionType) { switch (layer->getCompositionType(displayId)) { case HWC2::Composition::Cursor: case HWC2::Composition::Device: case HWC2::Composition::Sideband: case HWC2::Composition::SolidColor: { const Layer::State& state(compositionInfo.layer->mLayer->getDrawingState()); const bool opaque = compositionInfo.layer->mLayer->isOpaque(state) && compositionInfo.layer->mLayer->getAlpha() == 1.0f; if (compositionInfo.hwc.clearClientTarget && !firstLayer && opaque && const Layer::State& state(layer->getDrawingState()); if (layer->getClearClientTarget(displayId) && !firstLayer && layer->isOpaque(state) && (layer->getAlpha() == 1.0f) && hasClientComposition) { // never clear the very first layer since we're // guaranteed the FB is already cleared compositionInfo.layer->clear(getRenderEngine()); layer->clearWithOpenGL(renderArea); } break; } case HWC2::Composition::Client: { compositionInfo.layer->mLayer->draw(renderArea, clip); layer->draw(renderArea, clip); break; } default: Loading