diff options
author | Dan Stoza <stoza@google.com> | 2015-12-02 18:34:06 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-12-02 18:34:06 +0000 |
commit | 46f8beb07fe2fa28b1c216485b91b894a1c8625b (patch) | |
tree | c3ec830944b4b2ca9c4c0a5d8a5bace8863b24ac | |
parent | 78d4fb8e771f85f6d7f04f6c0eb7aed1992b3a43 (diff) | |
parent | b2e3095a604e16d5d80d1e3d38bb92a6c37bd127 (diff) | |
download | native-46f8beb07fe2fa28b1c216485b91b894a1c8625b.tar.gz |
Merge "bug#460672 framebuffer surface can\'t keep triple buffer if define NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3"
am: b2e3095a60
* commit 'b2e3095a604e16d5d80d1e3d38bb92a6c37bd127':
bug#460672 framebuffer surface can't keep triple buffer if define NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index 13d44f39b5..bdf8f7404a 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -88,21 +88,22 @@ DisplayDevice::DisplayDevice( mPowerMode(HWC_POWER_MODE_OFF), mActiveConfig(0) { - mNativeWindow = new Surface(producer, false); + Surface* surface; + mNativeWindow = surface = new Surface(producer, false); ANativeWindow* const window = mNativeWindow.get(); /* * Create our display's surface */ - EGLSurface surface; + EGLSurface eglSurface; EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (config == EGL_NO_CONFIG) { config = RenderEngine::chooseEglConfig(display, format); } - surface = eglCreateWindowSurface(display, config, window, NULL); - eglQuerySurface(display, surface, EGL_WIDTH, &mDisplayWidth); - eglQuerySurface(display, surface, EGL_HEIGHT, &mDisplayHeight); + eglSurface = eglCreateWindowSurface(display, config, window, NULL); + eglQuerySurface(display, eglSurface, EGL_WIDTH, &mDisplayWidth); + eglQuerySurface(display, eglSurface, EGL_HEIGHT, &mDisplayHeight); // Make sure that composition can never be stalled by a virtual display // consumer that isn't processing buffers fast enough. We have to do this @@ -116,7 +117,7 @@ DisplayDevice::DisplayDevice( mConfig = config; mDisplay = display; - mSurface = surface; + mSurface = eglSurface; mFormat = format; mPageFlipCount = 0; mViewport.makeInvalid(); @@ -142,6 +143,10 @@ DisplayDevice::DisplayDevice( // initialize the display orientation transform. setProjection(DisplayState::eOrientationDefault, mViewport, mFrame); + +#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS + surface->allocateBuffers(); +#endif } DisplayDevice::~DisplayDevice() { |