Skip to content

Commit

Permalink
SF: Modify logic to handle "transparent Region" for displayFrame
Browse files Browse the repository at this point in the history
sourceCrop and displayFrame calculations according to "transparent Region"
are not synchronized. Because of this mismatch scaling is introduced,
causing corruption in UI. To avoid this scaling, map displayFrame to
sourceCrop, apply reduce and remap result to displayFrame.

CRs-Fixed: 660699

Change-Id: I1e7ad5b1c8932413f53bb94a2e62895661b97057
  • Loading branch information
Dileep Kumar Reddi authored and hyperb1iss committed Jul 14, 2014
1 parent 24165a2 commit 934d46a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions services/surfaceflinger/Layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,22 @@ void Layer::setGeometry(
// here we're guaranteed that the layer's transform preserves rects
Rect frame(s.transform.transform(computeBounds()));
frame.intersect(hw->getViewport(), &frame);

//map frame(displayFrame) to sourceCrop
frame = s.transform.inverse().transform(frame);

// make sure sourceCrop with in the window's bounds
frame.intersect(Rect(s.active.w, s.active.h), &frame);

// subtract the transparent region and snap to the bounds
frame = reduce(frame, s.activeTransparentRegion);

//remap frame to displayFrame
frame = s.transform.transform(frame);

// make sure frame(displayFrame) with in viewframe
frame.intersect(hw->getViewport(), &frame);

const Transform& tr(hw->getTransform());
layer.setFrame(tr.transform(frame));
#ifdef QCOM_BSP
Expand Down

0 comments on commit 934d46a

Please sign in to comment.