OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 University of Szeged | 2 * Copyright (C) 2011 University of Szeged |
3 * Copyright (C) 2011 Zoltan Herczeg | 3 * Copyright (C) 2011 Zoltan Herczeg |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (spotLightSource->specularExponent() == 1) | 144 if (spotLightSource->specularExponent() == 1) |
145 neonData.flags |= FLAG_CONE_EXPONENT_IS_1; | 145 neonData.flags |= FLAG_CONE_EXPONENT_IS_1; |
146 } else { | 146 } else { |
147 ASSERT(m_lightSource->type() == LS_DISTANT); | 147 ASSERT(m_lightSource->type() == LS_DISTANT); |
148 floatArguments.lightX = paintingData.lightVector.x(); | 148 floatArguments.lightX = paintingData.lightVector.x(); |
149 floatArguments.lightY = paintingData.lightVector.y(); | 149 floatArguments.lightY = paintingData.lightVector.y(); |
150 floatArguments.lightZ = paintingData.lightVector.z(); | 150 floatArguments.lightZ = paintingData.lightVector.z(); |
151 floatArguments.padding2 = 1; | 151 floatArguments.padding2 = 1; |
152 } | 152 } |
153 | 153 |
| 154 floatArguments.lightX *= paintingData.worldScale.x(); |
| 155 floatArguments.lightY *= paintingData.worldScale.y(); |
| 156 floatArguments.lightZ *= paintingData.worldScale.z(); |
| 157 floatArguments.lightX -= paintingData.width(); |
| 158 floatArguments.lightY -= paintingData.height(); |
| 159 |
154 // Set lighting arguments. | 160 // Set lighting arguments. |
155 floatArguments.surfaceScale = data.surfaceScale; | 161 floatArguments.surfaceScale = data.surfaceScale; |
156 floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4; | 162 floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4; |
157 if (m_lightingType == FELighting::DiffuseLighting) { | 163 if (m_lightingType == FELighting::DiffuseLighting) { |
158 floatArguments.diffuseConstant = m_diffuseConstant; | 164 floatArguments.diffuseConstant = m_diffuseConstant; |
159 } else { | 165 } else { |
160 neonData.flags |= FLAG_SPECULAR_LIGHT; | 166 neonData.flags |= FLAG_SPECULAR_LIGHT; |
161 floatArguments.diffuseConstant = m_specularConstant; | 167 floatArguments.diffuseConstant = m_specularConstant; |
162 neonData.specularExponent = getPowerCoefficients(m_specularExponent); | 168 neonData.specularExponent = getPowerCoefficients(m_specularExponent); |
163 if (m_specularExponent == 1) | 169 if (m_specularExponent == 1) |
(...skipping 30 matching lines...) Expand all Loading... |
194 } | 200 } |
195 | 201 |
196 neonDrawLighting(&neonData); | 202 neonDrawLighting(&neonData); |
197 } | 203 } |
198 | 204 |
199 } // namespace WebCore | 205 } // namespace WebCore |
200 | 206 |
201 #endif // CPU(ARM_NEON) && COMPILER(GCC) | 207 #endif // CPU(ARM_NEON) && COMPILER(GCC) |
202 | 208 |
203 #endif // FELightingNEON_h | 209 #endif // FELightingNEON_h |
OLD | NEW |