OSDN Git Service

[cherry-pick] Optimize glGetIntegerv to reduce the cost of translating
authorLizhe Liu <lizhe.liu@intel.com>
Wed, 27 May 2015 03:13:23 +0000 (11:13 +0800)
committerYahan Zhou <yahan@google.com>
Wed, 1 Jun 2016 18:08:56 +0000 (11:08 -0700)
commite41f4ef67ad3161b23156816b4391e41c854b074
tree2edaabed629733c1e53c699efda857d5b6455130
parent1d9430c0fa9d015f0a72b29f26f41a0a04885d68
[cherry-pick] Optimize glGetIntegerv to reduce the cost of translating

Hardware GLES emulation in the Android platform is implemented
with a mix of components. Translator module is one of the most
important components in emulator. It translate the function
calls into calls to the appropriate desktop APIs and cost lots
of reference to complete it. So optimization must be beneficial
to us. GL_MAX_CUBE_MAP_TEXTURE_SIZE, GL_MAX_RENDERBUFFER_SIZE
and GL_MAX_TEXTURE_SIZE are the rough estimate value of the
largest texture which the OPENGL can handle. All of them are
constant value. So there is no need for us to translate them
from guest os to host os every time. We can cache the value
after first time and reuse it next time.

Cherry-pick from:

https://android-review.googlesource.com/#/c/151899

Change-Id: I1a0352c40b667bafd6ec1fb66a8060d7fe4a415d
Signed-off-by: Lizhe Liu <lizhe.liu@intel.com>
system/GLESv2_enc/GL2Encoder.cpp
system/GLESv2_enc/GL2Encoder.h