am 0b91d7e2: am 131866e1: Merge "Add glFlush in surfaceflinger screenshot code." into lmp-mr1-dev

* commit '0b91d7e27718fc530bcad78a7ff2a51b90142059':
  Add glFlush in surfaceflinger screenshot code.
This commit is contained in:
Riley Andrews 2014-10-24 18:43:37 +00:00 committed by Android Git Automerger
commit b9b24e503f
3 changed files with 7 additions and 0 deletions

View File

@ -219,6 +219,10 @@ void RenderEngine::fillRegionWithColor(const Region& region, uint32_t height,
drawMesh(mesh);
}
void RenderEngine::flush() {
glFlush();
}
void RenderEngine::clearWithColor(float red, float green, float blue, float alpha) {
glClearColor(red, green, blue, alpha);
glClear(GL_COLOR_BUFFER_BIT);

View File

@ -67,6 +67,7 @@ public:
virtual void dump(String8& result);
// helpers
void flush();
void clearWithColor(float red, float green, float blue, float alpha);
void fillRegionWithColor(const Region& region, uint32_t height,
float red, float green, float blue, float alpha);

View File

@ -3205,6 +3205,8 @@ status_t SurfaceFlinger::captureScreenImplLocked(
EGLSyncKHR sync;
if (!DEBUG_SCREENSHOTS) {
sync = eglCreateSyncKHR(mEGLDisplay, EGL_SYNC_NATIVE_FENCE_ANDROID, NULL);
// native fence fd will not be populated until flush() is done.
getRenderEngine().flush();
} else {
sync = EGL_NO_SYNC_KHR;
}