Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0adab82d authored by Baldev Sahu's avatar Baldev Sahu Committed by Arne Coucheron
Browse files

sf: Limit co-ordinates difference fix for high res panel

- Limit co-ordinate difference fix for high res panel as this
  is causing pixel shift on low res panel due to rounding.

Change-Id: I1d697bc76ff6f962f399f6f692e347d04a059443
parent db0e94b4
Loading
Loading
Loading
Loading
+64 −33
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@
#include <mutex>

#define DEBUG_RESIZE    0
#ifdef QTI_BSP
#define NUM_PIXEL_LOW_RES_PANEL (720*1280)
#endif

namespace android {

@@ -1059,8 +1062,10 @@ void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
     * like more of a hack.
     */
#ifdef QTI_BSP
    const uint32_t hw_w = hw->getWidth();
    const uint32_t hw_h = hw->getHeight();
    Rect win(s.active.w, s.active.h);

    if((hw_w * hw_h) > NUM_PIXEL_LOW_RES_PANEL) {
        if (!s.crop.isEmpty()) {
            win = s.crop;
        }
@@ -1070,6 +1075,20 @@ void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
        win = s.active.transform.inverse().transform(win);
        win.intersect(Rect(s.active.w, s.active.h), &win);
        win = reduce(win, s.activeTransparentRegion);
    } else {
        win = computeBounds();

        if (!s.finalCrop.isEmpty()) {
            win = s.active.transform.transform(win);
            if (!win.intersect(s.finalCrop, &win)) {
                win.clear();
            }
            win = s.active.transform.inverse().transform(win);
            if (!win.intersect(computeBounds(), &win)) {
                win.clear();
            }
        }
    }
#else
    Rect win(computeBounds());

@@ -1281,6 +1300,9 @@ void Layer::computeGeometry(const sp<const DisplayDevice>& hw, Mesh& mesh,
        win.intersect(s.crop, &win);
    }
#ifdef QTI_BSP
    const uint32_t hw_w = hw->getWidth();
    uint32_t orientation = 0;
    if((hw_w * hw_h) > NUM_PIXEL_LOW_RES_PANEL) {
        win = s.active.transform.transform(win);
        win.intersect(hw->getViewport(), &win);
        win = s.active.transform.inverse().transform(win);
@@ -1297,19 +1319,21 @@ void Layer::computeGeometry(const sp<const DisplayDevice>& hw, Mesh& mesh,
            }
            transform = Transform(invTransform) * transform;
        }
    const uint32_t orientation = transform.getOrientation();
        orientation = transform.getOrientation();
        if (!(orientation | mCurrentTransform | mTransformHint)) {
            if (!useIdentityTransform) {
                win = s.active.transform.transform(win);
                win.intersect(hw->getViewport(), &win);
            }
        }
    } else {
        win = reduce(win, s.activeTransparentRegion);
    }
#else
    win = reduce(win, s.activeTransparentRegion);
#endif



    // subtract the transparent region and snap to the bounds

    vec2 lt = vec2(win.left, win.top);
@@ -1319,12 +1343,19 @@ void Layer::computeGeometry(const sp<const DisplayDevice>& hw, Mesh& mesh,

    if (!useIdentityTransform) {
#ifdef QTI_BSP
        if((hw_w * hw_h) > NUM_PIXEL_LOW_RES_PANEL) {
            if (orientation | mCurrentTransform | mTransformHint) {
                lt = s.active.transform.transform(lt);
                lb = s.active.transform.transform(lb);
                rb = s.active.transform.transform(rb);
                rt = s.active.transform.transform(rt);
            }
        } else {
            lt = s.active.transform.transform(lt);
            lb = s.active.transform.transform(lb);
            rb = s.active.transform.transform(rb);
            rt = s.active.transform.transform(rt);
        }
#else
        lt = s.active.transform.transform(lt);
        lb = s.active.transform.transform(lb);