Skip to content

Commit b946a56

Browse files
committed
Fix screen off animation when in landscape
Change-Id: I4bc5b12d7a64a4bf8b9a851594be4d60b790d1ed
1 parent 9e076a6 commit b946a56

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,8 @@ status_t SurfaceFlinger::renderScreenToTextureLocked(DisplayID dpy,
18141814
// redraw the screen entirely...
18151815
glClearColor(0,0,0,1);
18161816
glClear(GL_COLOR_BUFFER_BIT);
1817+
glMatrixMode(GL_MODELVIEW);
1818+
glLoadIdentity();
18171819
const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
18181820
const size_t count = layers.size();
18191821
for (size_t i=0 ; i<count ; ++i) {
@@ -1845,7 +1847,7 @@ status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
18451847
const DisplayHardware& hw(graphicPlane(0).displayHardware());
18461848
const uint32_t hw_w = hw.getWidth();
18471849
const uint32_t hw_h = hw.getHeight();
1848-
const Region screenBounds(hw.bounds());
1850+
const Region screenBounds(hw.getBounds());
18491851

18501852
GLfloat u, v;
18511853
GLuint tname;
@@ -1855,7 +1857,7 @@ status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
18551857
}
18561858

18571859
GLfloat vtx[8];
1858-
const GLfloat texCoords[4][2] = { {0,1}, {0,1-v}, {u,1-v}, {u,1} };
1860+
const GLfloat texCoords[4][2] = { {0,0}, {0,v}, {u,v}, {u,0} };
18591861
glBindTexture(GL_TEXTURE_2D, tname);
18601862
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
18611863
glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -1941,6 +1943,12 @@ status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
19411943
s_curve_interpolator itb(nbFrames, 8.5f);
19421944

19431945
v_stretch vverts(hw_w, hw_h);
1946+
1947+
glMatrixMode(GL_TEXTURE);
1948+
glLoadIdentity();
1949+
glMatrixMode(GL_MODELVIEW);
1950+
glLoadIdentity();
1951+
19441952
glEnable(GL_BLEND);
19451953
glBlendFunc(GL_ONE, GL_ONE);
19461954
for (int i=0 ; i<nbFrames ; i++) {

0 commit comments

Comments
 (0)