summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2014-06-26 16:01:02 -0700
committerMichael Lentine <mlentine@google.com>2014-07-30 11:23:44 -0700
commit1f6078aef71b1d3f080cd565adbec350c71088dd (patch)
treec5dbb3eb6ee45d28e6e30a6b0230a23143ec1500
parent99c7dc596adeef45604a596075043e1f37daf7ca (diff)
downloadframeworks_native-1f6078aef71b1d3f080cd565adbec350c71088dd.zip
frameworks_native-1f6078aef71b1d3f080cd565adbec350c71088dd.tar.gz
frameworks_native-1f6078aef71b1d3f080cd565adbec350c71088dd.tar.bz2
Have VirtualDisplays send SF resize messages when resizing
Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
-rw-r--r--include/gui/SurfaceComposerClient.h1
-rw-r--r--include/private/gui/LayerState.h4
-rw-r--r--libs/gui/SurfaceComposerClient.cpp14
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h1
4 files changed, 19 insertions, 1 deletions
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 65313df..c73ef70 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -146,6 +146,7 @@ public:
const sp<IGraphicBufferProducer>& bufferProducer);
static void setDisplayLayerStack(const sp<IBinder>& token,
uint32_t layerStack);
+ static void setDisplaySize(const sp<IBinder>& token, uint32_t width, uint32_t height);
/* setDisplayProjection() defines the projection of layer stacks
* to a given display.
diff --git a/include/private/gui/LayerState.h b/include/private/gui/LayerState.h
index 5584fb1..2fa6ff9 100644
--- a/include/private/gui/LayerState.h
+++ b/include/private/gui/LayerState.h
@@ -113,7 +113,8 @@ struct DisplayState {
enum {
eSurfaceChanged = 0x01,
eLayerStackChanged = 0x02,
- eDisplayProjectionChanged = 0x04
+ eDisplayProjectionChanged = 0x04,
+ eDisplaySizeChanged = 0x08
};
uint32_t what;
@@ -123,6 +124,7 @@ struct DisplayState {
uint32_t orientation;
Rect viewport;
Rect frame;
+ uint32_t width, height;
status_t write(Parcel& output) const;
status_t read(const Parcel& input);
};
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 3bee3fc..6e13207 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -166,6 +166,7 @@ public:
uint32_t orientation,
const Rect& layerStackRect,
const Rect& displayRect);
+ void setDisplaySize(const sp<IBinder>& token, uint32_t width, uint32_t height);
static void setAnimationTransaction() {
Composer::getInstance().setAnimationTransactionImpl();
@@ -426,6 +427,14 @@ void Composer::setDisplayProjection(const sp<IBinder>& token,
mForceSynchronous = true; // TODO: do we actually still need this?
}
+void Composer::setDisplaySize(const sp<IBinder>& token, uint32_t width, uint32_t height) {
+ Mutex::Autolock _l(mLock);
+ DisplayState& s(getDisplayStateLocked(token));
+ s.width = width;
+ s.height = height;
+ s.what |= DisplayState::eDisplaySizeChanged;
+}
+
// ---------------------------------------------------------------------------
SurfaceComposerClient::SurfaceComposerClient()
@@ -621,6 +630,11 @@ void SurfaceComposerClient::setDisplayProjection(const sp<IBinder>& token,
layerStackRect, displayRect);
}
+void SurfaceComposerClient::setDisplaySize(const sp<IBinder>& token,
+ uint32_t width, uint32_t height) {
+ Composer::getInstance().setDisplaySize(token, width, height);
+}
+
// ----------------------------------------------------------------------------
status_t SurfaceComposerClient::getDisplayConfigs(
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 5ae3d0b..d5547b3 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -170,6 +170,7 @@ private:
Rect viewport;
Rect frame;
uint8_t orientation;
+ uint32_t width, height;
String8 displayName;
bool isSecure;
};