summaryrefslogtreecommitdiffstats
path: root/libpixelflinger/codeflinger/blending.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:08:08 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:08:08 -0800
commit35237d135807af84bf9b0e5b8d7f8633e58db6f5 (patch)
treed8bcf3ada2182d248604728285dd80abb466f22a /libpixelflinger/codeflinger/blending.cpp
parent4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 (diff)
downloadsystem_core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.tar.gz
system_core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.tar.bz2
system_core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.zip
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'libpixelflinger/codeflinger/blending.cpp')
-rw-r--r--libpixelflinger/codeflinger/blending.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpixelflinger/codeflinger/blending.cpp b/libpixelflinger/codeflinger/blending.cpp
index 6d3b28201..f10217b74 100644
--- a/libpixelflinger/codeflinger/blending.cpp
+++ b/libpixelflinger/codeflinger/blending.cpp
@@ -50,6 +50,12 @@ void GGLAssembler::build_fog(
integer_t factor(scratches.obtain(), 16, CORRUPTIBLE);
CONTEXT_LOAD(factor.reg, generated_vars.f);
+ // clamp fog factor (TODO: see if there is a way to guarantee
+ // we won't overflow, when setting the iterators)
+ BIC(AL, 0, factor.reg, factor.reg, reg_imm(factor.reg, ASR, 31));
+ CMP(AL, factor.reg, imm( 0x10000 ));
+ MOV(HS, 0, factor.reg, imm( 0x10000 ));
+
build_blendFOneMinusF(temp, factor, fragment, fogColor);
}
}