diff options
author | Mykola Ostrovskyy <mykola@ti.com> | 2012-09-24 15:42:06 +0300 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-28 21:16:26 +0200 |
commit | f4c1851fbeec089713ebeb4201b26137e9bcf910 (patch) | |
tree | 882b88b1b1d022b45336ca6384b9f2a95e77bcce /hwc | |
parent | 8e7e2d97aac8c94baefc73a57f0fa046134b77fc (diff) | |
download | hardware_ti_omap4-f4c1851fbeec089713ebeb4201b26137e9bcf910.zip hardware_ti_omap4-f4c1851fbeec089713ebeb4201b26137e9bcf910.tar.gz hardware_ti_omap4-f4c1851fbeec089713ebeb4201b26137e9bcf910.tar.bz2 |
hwc: Support odd-sized dockable layers
During transition effects Android framework may rescale
dockable layers, and resulting window size may have an odd
width or height. If the layer is significantly upscaled on
external display, the rounding error of integer division
will be blown up and may shift the adjusted overlay window
by few pixels.
Change-Id: Ib4034f4a34bb81e02fbcdb3c709c91dfb853bfaa
Signed-off-by: Mykola Ostrovskyy <mykola@ti.com>
Diffstat (limited to 'hwc')
-rw-r--r-- | hwc/hwc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -639,7 +639,7 @@ static void omap4_hwc_setup_layer(omap4_hwc_device_t *hwc_dev, struct dss2_ovl_i const float m_unit[2][3] = { { 1., 0., 0. }, { 0., 1., 0. } }; -static inline void m_translate(float m[2][3], int dx, int dy) +static inline void m_translate(float m[2][3], float dx, float dy) { m[0][2] += dx; m[1][2] += dy; @@ -718,7 +718,7 @@ static void set_ext_matrix(omap4_hwc_ext_t *ext, struct hwc_rect region) m = (center-from-target-center) * (scale-to-target) * (mirror) * (rotate) * (center-to-original-center) */ memcpy(ext->m, m_unit, sizeof(m_unit)); - m_translate(ext->m, -(orig_w >> 1) - region.left, -(orig_h >> 1) - region.top); + m_translate(ext->m, -(orig_w / 2.0f) - region.left, -(orig_h / 2.0f) - region.top); m_rotate(ext->m, ext->current.rotation); if (ext->current.hflip) m_scale(ext->m, 1, -1, 1, 1); |