summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-02 17:09:18 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-02 17:09:18 -0700
commitd0ec2401e9e31a5319e205acc785f5db19212010 (patch)
tree7465fd4099ba1ecc7d753fd893faf6ad9dd52478 /services
parent9a4eacfeb488ba27979111ee7adc87dcfe85d161 (diff)
parent0fb1a9458caec1369f797ca48f685d8bc90cc43f (diff)
downloadframeworks_base-d0ec2401e9e31a5319e205acc785f5db19212010.zip
frameworks_base-d0ec2401e9e31a5319e205acc785f5db19212010.tar.gz
frameworks_base-d0ec2401e9e31a5319e205acc785f5db19212010.tar.bz2
Merge "update HWC data structures even when a layer is marked for SKIP"
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Layer.cpp34
-rw-r--r--services/surfaceflinger/LayerBase.cpp38
2 files changed, 43 insertions, 29 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 886bb2a..32f300f 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -172,17 +172,14 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
void Layer::setGeometry(hwc_layer_t* hwcl)
{
- hwcl->compositionType = HWC_FRAMEBUFFER;
- hwcl->hints = 0;
- hwcl->flags = 0;
- hwcl->transform = 0;
- hwcl->blending = HWC_BLENDING_NONE;
+ LayerBaseClient::setGeometry(hwcl);
+
+ hwcl->flags &= ~HWC_SKIP_LAYER;
// we can't do alpha-fade with the hwc HAL
const State& s(drawingState());
if (s.alpha < 0xFF) {
hwcl->flags = HWC_SKIP_LAYER;
- return;
}
/*
@@ -205,26 +202,9 @@ void Layer::setGeometry(hwc_layer_t* hwcl)
// we can only handle simple transformation
if (finalTransform & Transform::ROT_INVALID) {
hwcl->flags = HWC_SKIP_LAYER;
- return;
- }
-
- hwcl->transform = finalTransform;
-
- if (!isOpaque()) {
- hwcl->blending = mPremultipliedAlpha ?
- HWC_BLENDING_PREMULT : HWC_BLENDING_COVERAGE;
+ } else {
+ hwcl->transform = finalTransform;
}
-
- // 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<hwc_rect_t const *>(
- visibleRegionScreen.getArray(
- &hwcl->visibleRegionScreen.numRects));
}
void Layer::setPerFrameData(hwc_layer_t* hwcl) {
@@ -235,9 +215,9 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) {
// HWC handle it.
hwcl->flags |= HWC_SKIP_LAYER;
hwcl->handle = NULL;
- return;
+ } else {
+ hwcl->handle = buffer->handle;
}
- hwcl->handle = buffer->handle;
if (isCropped()) {
hwcl->sourceCrop.left = mCurrentCrop.left;
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index c86c659..e04c533 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<hwc_rect_t const *>(
+ 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)