diff options
author | Michael Lentine <mlentine@google.com> | 2014-07-18 15:34:25 -0700 |
---|---|---|
committer | Michael Lentine <mlentine@google.com> | 2014-07-30 14:36:25 -0700 |
commit | 47e45405d1533aa73307014f7bf371e118695cf3 (patch) | |
tree | cabc47d4088308ed27b799d998a6d4a705e18058 /services/surfaceflinger/DisplayDevice.cpp | |
parent | 1f6078aef71b1d3f080cd565adbec350c71088dd (diff) | |
download | frameworks_native-47e45405d1533aa73307014f7bf371e118695cf3.zip frameworks_native-47e45405d1533aa73307014f7bf371e118695cf3.tar.gz frameworks_native-47e45405d1533aa73307014f7bf371e118695cf3.tar.bz2 |
Allow for resizing of Virtual Displays.
Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual
display is used. Add functionality in VirtualDisplaySurface to resize the
buffers aquired in the QueueBufferOutput. Add transaction support in
SurfaceFlinger for resize. Add the modification of the size in DisplayDevice.
Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b
Tested: None
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index e3e0b0a..2213259 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -102,6 +102,7 @@ DisplayDevice::DisplayDevice( if (mType >= DisplayDevice::DISPLAY_VIRTUAL) window->setSwapInterval(window, 0); + mConfig = config; mDisplay = display; mSurface = surface; mFormat = format; @@ -397,6 +398,22 @@ status_t DisplayDevice::orientationToTransfrom( return NO_ERROR; } +void DisplayDevice::setDisplaySize(const int newWidth, const int newHeight) { + dirtyRegion.set(getBounds()); + + mDisplaySurface->resizeBuffers(newWidth, newHeight); + + ANativeWindow* const window = mNativeWindow.get(); + mSurface = eglCreateWindowSurface(mDisplay, mConfig, window, NULL); + eglQuerySurface(mDisplay, mSurface, EGL_WIDTH, &mDisplayWidth); + eglQuerySurface(mDisplay, mSurface, EGL_HEIGHT, &mDisplayHeight); + + LOG_FATAL_IF(mDisplayWidth != newWidth, + "Unable to set new width to %d", newWidth); + LOG_FATAL_IF(mDisplayHeight != newHeight, + "Unable to set new height to %d", newHeight); +} + void DisplayDevice::setProjection(int orientation, const Rect& newViewport, const Rect& newFrame) { Rect viewport(newViewport); |