summaryrefslogtreecommitdiff
path: root/libs/hwui/Program.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-12-12 11:44:43 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-12 11:44:43 -0800
commit11326aa1b9482fefa0c0bdcb7e48cfeae6f9e33d (patch)
treefb4c9c33f7b6fa49292382e5bb2028dbcfe7b308 /libs/hwui/Program.cpp
parentee698a01bdc9ea7aa2b1cd729109b194a130f9f5 (diff)
parent24edca8b526515979778e577191089a57f5277d7 (diff)
Merge "Code cleanup"
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r--libs/hwui/Program.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp
index 516546f24a57..a9f13f7cd03f 100644
--- a/libs/hwui/Program.cpp
+++ b/libs/hwui/Program.cpp
@@ -29,6 +29,8 @@ Program::Program(const char* vertex, const char* fragment) {
mInitialized = false;
mHasColorUniform = false;
+ // No need to cache compiled shaders, rely instead on Android's
+ // persistent shaders cache
GLuint vertexShader = buildShader(vertex, GL_VERTEX_SHADER);
if (vertexShader) {
@@ -135,10 +137,11 @@ void Program::set(const mat4& projectionMatrix, const mat4& modelViewMatrix,
const mat4& transformMatrix, bool offset) {
mat4 t(projectionMatrix);
if (offset) {
- // offset screenspace xy by an amount that compensates for typical precision issues
- // in GPU hardware that tends to paint hor/vert lines in pixels shifted up and to the left.
- // This offset value is based on an assumption that some hardware may use as little
- // as 12.4 precision, so we offset by slightly more than 1/16.
+ // offset screenspace xy by an amount that compensates for typical precision
+ // issues in GPU hardware that tends to paint hor/vert lines in pixels shifted
+ // up and to the left.
+ // This offset value is based on an assumption that some hardware may use as
+ // little as 12.4 precision, so we offset by slightly more than 1/16.
t.translate(.375, .375, 0);
}
t.multiply(transformMatrix);