OSDN Git Service

Fix dEQP-EGL.functional.resize.pixel_density.*
authorLingfeng Yang <lfy@google.com>
Fri, 23 Sep 2016 20:49:09 +0000 (13:49 -0700)
committerLingfeng Yang <lfy@google.com>
Fri, 23 Sep 2016 21:37:48 +0000 (14:37 -0700)
commit829f7a69ea3ef859a555760567539822d18f2bc2
treee4d9ff9991d2b9307e7ac7bbd54b920fd6b75091
parentbbe191b2311e3faa73e7497fec8f04d8c1739a8b
Fix dEQP-EGL.functional.resize.pixel_density.*

bug: 31703045

These tests attempt to calculate native DPI by creating
very small buffers, rendering them to a high resolution screen,
and then re-deriving the native DPI by scaling buffer size
against the window resolution in screen pixels.

Previously, they failed because EGL_HORIZONTAL_RESOLUTION
actually means to get the effective DPI of an EGL texture,
which is different from native DPI.

For example, if the screen is 2 pixels across and 4 meters wide,
the native dot pitch is 0.5 pixels per meter, but if
there is a 1x1 pixel texture filling the entire screen,
EGL_HORIZONTAL_RESOLUTION should return 0.25 pixels
per meter (1 texture pixel, 4 meters -> 0.25 ppm).

This CL queries the native window resolution and attempts
to calculate effective DPI from that.

Change-Id: I7f12d7964529bc95b5f89640dea00e9e16c66799
system/egl/egl.cpp