summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-01-27 00:17:20 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-01-27 00:17:21 +0000
commitbf89eb7b24f930e77be57bc7b6393e39691a4d35 (patch)
tree5431f1d3baeac0687e25fe0e25106266e13ea34b /services/surfaceflinger/Layer.cpp
parent1478db5b4717877b32f9ad0cd3d066db01e7ca41 (diff)
parent2f5f8a51f5994cf14837030d4b3b252a9d1b950b (diff)
Merge changes from topic 'vr_wm'
* changes: VR: Add ability to pass layer info through SurfaceFlinger VR: Create VR implementation for HWC HIDL interface
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 6fd9cd75b3..226e70a821 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -140,6 +140,8 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
mCurrentState.sequence = 0;
mCurrentState.requested = mCurrentState.active;
mCurrentState.dataSpace = HAL_DATASPACE_UNKNOWN;
+ mCurrentState.appId = 0;
+ mCurrentState.type = 0;
// drawing state & current state are identical
mDrawingState = mCurrentState;
@@ -676,6 +678,10 @@ void Layer::setGeometry(
ALOGE_IF(error != HWC2::Error::None, "[%s] Failed to set Z %u: %s (%d)",
mName.string(), z, to_string(error).c_str(),
static_cast<int32_t>(error));
+
+ error = hwcLayer->setInfo(s.type, s.appId);
+ ALOGE_IF(error != HWC2::Error::None, "[%s] Failed to set info (%d)",
+ mName.string(), static_cast<int32_t>(error));
#else
if (!frame.intersect(hw->getViewport(), &frame)) {
frame.clear();
@@ -1747,6 +1753,13 @@ bool Layer::setOverrideScalingMode(int32_t scalingMode) {
return true;
}
+void Layer::setInfo(uint32_t type, uint32_t appId) {
+ mCurrentState.appId = appId;
+ mCurrentState.type = type;
+ mCurrentState.modified = true;
+ setTransactionFlags(eTransactionNeeded);
+}
+
uint32_t Layer::getEffectiveScalingMode() const {
if (mOverrideScalingMode >= 0) {
return mOverrideScalingMode;