commit | b97b251c26b801b26f2630e3a2e3f93e4088f2c5 | [log] [tgz] |
---|---|---|
author | Jason Sams <rjsams@android.com> | Sun Jan 16 15:04:08 2011 -0800 |
committer | Jason Sams <rjsams@android.com> | Sun Jan 16 16:11:42 2011 -0800 |
tree | 2e9db711d8474aa41ceeccbc9e36b030d92b301a | |
parent | 300406abd4a1e96d18d2a6486b3e41ddd3cee8b4 [diff] [blame] |
Add error checks to the copyFrom functions. Change-Id: Iac064c52eb58b05a94fa1c432304c6216256555b
diff --git a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java index 1af31f8..666a3e6 100644 --- a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java +++ b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
@@ -280,9 +280,10 @@ pf.mTextureCount = MAX_TEXTURE; if (!mVaryingColorEnable) { Allocation constantData = Allocation.createTyped(mRS,constType); - float[] data = new float[4]; - data[0] = data[1] = data[2] = data[3] = 1.0f; - constantData.copyFrom(data); + FieldPacker fp = new FieldPacker(16); + Float4 f4 = new Float4(1.f, 1.f, 1.f, 1.f); + fp.addF32(f4); + constantData.setFromFieldPacker(0, fp); pf.bindConstants(constantData, 0); } return pf;