summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author Ruben Brunk <rubenbrunk@google.com> 2014-07-14 22:57:34 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-07-14 18:37:51 +0000
commit2ad9d8a6e71f80b373c3ed0fece26b286d846292 (patch)
tree273d3c03f6fd0ae70c8255f7f13c9a00e1cb7e19 /services/surfaceflinger/Layer.cpp
parentb7d559be1f931585c444a54637cd49cda248a8fb (diff)
parent1681d95989271f3a9ac0dbb93d10e4a29f2b4444 (diff)
Merge "Add sticky transform to surfaceflinger." into lmp-dev
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 63bc257f52..4861e34026 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -624,6 +624,17 @@ void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
engine.disableBlending();
}
+uint32_t Layer::getProducerStickyTransform() const {
+ int producerStickyTransform = 0;
+ int ret = mProducer->query(NATIVE_WINDOW_STICKY_TRANSFORM, &producerStickyTransform);
+ if (ret != OK) {
+ ALOGW("%s: Error %s (%d) while querying window sticky transform.", __FUNCTION__,
+ strerror(-ret), ret);
+ return 0;
+ }
+ return static_cast<uint32_t>(producerStickyTransform);
+}
+
void Layer::setFiltering(bool filtering) {
mFiltering = filtering;
}
@@ -992,10 +1003,12 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
Layer::State& front;
Layer::State& current;
bool& recomputeVisibleRegions;
+ bool stickyTransformSet;
Reject(Layer::State& front, Layer::State& current,
- bool& recomputeVisibleRegions)
+ bool& recomputeVisibleRegions, bool stickySet)
: front(front), current(current),
- recomputeVisibleRegions(recomputeVisibleRegions) {
+ recomputeVisibleRegions(recomputeVisibleRegions),
+ stickyTransformSet(stickySet) {
}
virtual bool reject(const sp<GraphicBuffer>& buf,
@@ -1058,12 +1071,12 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
front.requested.crop.getHeight());
}
- if (!isFixedSize) {
+ if (!isFixedSize && !stickyTransformSet) {
if (front.active.w != bufWidth ||
front.active.h != bufHeight) {
// reject this buffer
- //ALOGD("rejecting buffer: bufWidth=%d, bufHeight=%d, front.active.{w=%d, h=%d}",
- // bufWidth, bufHeight, front.active.w, front.active.h);
+ ALOGE("rejecting buffer: bufWidth=%d, bufHeight=%d, front.active.{w=%d, h=%d}",
+ bufWidth, bufHeight, front.active.w, front.active.h);
return true;
}
}
@@ -1092,8 +1105,8 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
}
};
-
- Reject r(mDrawingState, getCurrentState(), recomputeVisibleRegions);
+ Reject r(mDrawingState, getCurrentState(), recomputeVisibleRegions,
+ getProducerStickyTransform() != 0);
status_t updateResult = mSurfaceFlingerConsumer->updateTexImage(&r,
mFlinger->mPrimaryDispSync);