sf : Apply user defined panel orientation to blur layer

Blur layer need to capture screen shot to create to blur
effect. Hence need to take care any user defined orientation
as well.

Change-Id: I1c0478810d12661edf2586293bbed342a5b4dc7e
This commit is contained in:
Ramakant Singh 2015-10-19 14:38:10 +05:30 committed by Steve Kondik
parent af9298115c
commit 2bb57a8bc3

View File

@ -224,6 +224,7 @@ void LayerBlur::onDraw(const sp<const DisplayDevice>& hw, const Region& /*clip*/
bool LayerBlur::captureScreen(const sp<const DisplayDevice>& hw, FBO& fbo, Texture& texture, int width, int height) { bool LayerBlur::captureScreen(const sp<const DisplayDevice>& hw, FBO& fbo, Texture& texture, int width, int height) {
ATRACE_CALL(); ATRACE_CALL();
ensureFbo(fbo, width, height, texture.getTextureName()); ensureFbo(fbo, width, height, texture.getTextureName());
Transform::orientation_flags rotation = Transform::ROT_0;
if(fbo.fbo == 0) { if(fbo.fbo == 0) {
ALOGE("captureScreen(). fbo.fbo == 0"); ALOGE("captureScreen(). fbo.fbo == 0");
return false; return false;
@ -237,6 +238,8 @@ bool LayerBlur::captureScreen(const sp<const DisplayDevice>& hw, FBO& fbo, Textu
texture.getTextureName(), 0); texture.getTextureName(), 0);
mFlinger->getRenderEngine().clearWithColor(0.0f, 0.0f, 0.0f, 1.0f); mFlinger->getRenderEngine().clearWithColor(0.0f, 0.0f, 0.0f, 1.0f);
if (hw->isPanelInverseMounted())
rotation = Transform::ROT_180;
mFlinger->renderScreenImplLocked( mFlinger->renderScreenImplLocked(
hw, hw,
Rect(0,0,width,height), Rect(0,0,width,height),
@ -244,7 +247,7 @@ bool LayerBlur::captureScreen(const sp<const DisplayDevice>& hw, FBO& fbo, Textu
0, getDrawingState().z-1, 0, getDrawingState().z-1,
false, false,
false, false,
Transform::ROT_0); rotation);
glBindFramebuffer(GL_FRAMEBUFFER, savedFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, savedFramebuffer);