From 0fb1a9458caec1369f797ca48f685d8bc90cc43f Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 2 Aug 2011 15:51:37 -0700 Subject: update HWC data structures even when a layer is marked for SKIP Change-Id: I16bcf44cd617814a14a795429bde2f39f411077d --- services/surfaceflinger/LayerBase.cpp | 38 +++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'services/surfaceflinger/LayerBase.cpp') diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index c86c659ad6cd..e04c533efc3b 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -302,13 +302,47 @@ void LayerBase::drawRegion(const Region& reg) const } } -void LayerBase::setGeometry(hwc_layer_t* hwcl) { - hwcl->flags |= HWC_SKIP_LAYER; +void LayerBase::setGeometry(hwc_layer_t* hwcl) +{ + hwcl->compositionType = HWC_FRAMEBUFFER; + hwcl->hints = 0; + hwcl->flags = HWC_SKIP_LAYER; + hwcl->transform = 0; + hwcl->blending = HWC_BLENDING_NONE; + + // this gives us only the "orientation" component of the transform + const State& s(drawingState()); + const uint32_t finalTransform = s.transform.getOrientation(); + // we can only handle simple transformation + if (finalTransform & Transform::ROT_INVALID) { + hwcl->flags = HWC_SKIP_LAYER; + } else { + hwcl->transform = finalTransform; + } + + if (!isOpaque()) { + hwcl->blending = mPremultipliedAlpha ? + HWC_BLENDING_PREMULT : HWC_BLENDING_COVERAGE; + } + + // scaling is already applied in mTransformedBounds + hwcl->displayFrame.left = mTransformedBounds.left; + hwcl->displayFrame.top = mTransformedBounds.top; + hwcl->displayFrame.right = mTransformedBounds.right; + hwcl->displayFrame.bottom = mTransformedBounds.bottom; + hwcl->visibleRegionScreen.rects = + reinterpret_cast( + visibleRegionScreen.getArray( + &hwcl->visibleRegionScreen.numRects)); } void LayerBase::setPerFrameData(hwc_layer_t* hwcl) { hwcl->compositionType = HWC_FRAMEBUFFER; hwcl->handle = NULL; + hwcl->sourceCrop.left = 0; + hwcl->sourceCrop.top = 0; + hwcl->sourceCrop.right = mTransformedBounds.width(); + hwcl->sourceCrop.bottom = mTransformedBounds.height(); } void LayerBase::setFiltering(bool filtering) -- cgit v1.2.3-59-g8ed1b