summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/DisplayDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 47dd0735db..f3acbc500d 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -259,18 +259,22 @@ EGLBoolean DisplayDevice::makeCurrent(EGLDisplay dpy,
if (sur != hw->mSurface) {
result = eglMakeCurrent(dpy, hw->mSurface, hw->mSurface, ctx);
if (result == EGL_TRUE) {
- GLsizei w = hw->mDisplayWidth;
- GLsizei h = hw->mDisplayHeight;
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- // put the origin in the left-bottom corner
- glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h
+ setViewportAndProjection(hw);
}
}
return result;
}
+void DisplayDevice::setViewportAndProjection(const sp<const DisplayDevice>& hw) {
+ GLsizei w = hw->mDisplayWidth;
+ GLsizei h = hw->mDisplayHeight;
+ glViewport(0, 0, w, h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ // put the origin in the left-bottom corner
+ glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h
+}
+
// ----------------------------------------------------------------------------
void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {