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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 }; | 110 }; |
111 | 111 |
112 // Set light source arguments. | 112 // Set light source arguments. |
113 floatArguments.constOne = 1; | 113 floatArguments.constOne = 1; |
114 | 114 |
115 floatArguments.colorRed = m_lightingColor.red(); | 115 floatArguments.colorRed = m_lightingColor.red(); |
116 floatArguments.colorGreen = m_lightingColor.green(); | 116 floatArguments.colorGreen = m_lightingColor.green(); |
117 floatArguments.colorBlue = m_lightingColor.blue(); | 117 floatArguments.colorBlue = m_lightingColor.blue(); |
118 floatArguments.padding4 = 0; | 118 floatArguments.padding4 = 0; |
119 | 119 |
120 if (m_lightSource->type() == LS_POINT) { | 120 if (data.lightSource->type() == LS_POINT) { |
121 neonData.flags |= FLAG_POINT_LIGHT; | 121 neonData.flags |= FLAG_POINT_LIGHT; |
122 PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_li
ghtSource.get()); | 122 PointLightSource* pointLightSource = static_cast<PointLightSource*>(data
.lightSource.get()); |
123 floatArguments.lightX = pointLightSource->position().x(); | 123 floatArguments.lightX = pointLightSource->position().x(); |
124 floatArguments.lightY = pointLightSource->position().y(); | 124 floatArguments.lightY = pointLightSource->position().y(); |
125 floatArguments.lightZ = pointLightSource->position().z(); | 125 floatArguments.lightZ = pointLightSource->position().z(); |
126 floatArguments.padding2 = 0; | 126 floatArguments.padding2 = 0; |
127 } else if (m_lightSource->type() == LS_SPOT) { | 127 } else if (data.lightSource->type() == LS_SPOT) { |
128 neonData.flags |= FLAG_SPOT_LIGHT; | 128 neonData.flags |= FLAG_SPOT_LIGHT; |
129 SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_light
Source.get()); | 129 SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(data.li
ghtSource.get()); |
130 floatArguments.lightX = spotLightSource->position().x(); | 130 floatArguments.lightX = spotLightSource->position().x(); |
131 floatArguments.lightY = spotLightSource->position().y(); | 131 floatArguments.lightY = spotLightSource->position().y(); |
132 floatArguments.lightZ = spotLightSource->position().z(); | 132 floatArguments.lightZ = spotLightSource->position().z(); |
133 floatArguments.padding2 = 0; | 133 floatArguments.padding2 = 0; |
134 | 134 |
135 floatArguments.directionX = paintingData.directionVector.x(); | 135 floatArguments.directionX = paintingData.directionVector.x(); |
136 floatArguments.directionY = paintingData.directionVector.y(); | 136 floatArguments.directionY = paintingData.directionVector.y(); |
137 floatArguments.directionZ = paintingData.directionVector.z(); | 137 floatArguments.directionZ = paintingData.directionVector.z(); |
138 floatArguments.padding3 = 0; | 138 floatArguments.padding3 = 0; |
139 | 139 |
140 floatArguments.coneCutOffLimit = paintingData.coneCutOffLimit; | 140 floatArguments.coneCutOffLimit = paintingData.coneCutOffLimit; |
141 floatArguments.coneFullLight = paintingData.coneFullLight; | 141 floatArguments.coneFullLight = paintingData.coneFullLight; |
142 floatArguments.coneCutOffRange = paintingData.coneCutOffLimit - painting
Data.coneFullLight; | 142 floatArguments.coneCutOffRange = paintingData.coneCutOffLimit - painting
Data.coneFullLight; |
143 neonData.coneExponent = getPowerCoefficients(spotLightSource->specularEx
ponent()); | 143 neonData.coneExponent = getPowerCoefficients(spotLightSource->specularEx
ponent()); |
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(data.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 // Set lighting arguments. | 154 // Set lighting arguments. |
155 floatArguments.surfaceScale = data.surfaceScale; | 155 floatArguments.surfaceScale = data.surfaceScale; |
156 floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4; | 156 floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4; |
157 if (m_lightingType == FELighting::DiffuseLighting) { | 157 if (m_lightingType == FELighting::DiffuseLighting) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 neonDrawLighting(&neonData); | 196 neonDrawLighting(&neonData); |
197 } | 197 } |
198 | 198 |
199 } // namespace WebCore | 199 } // namespace WebCore |
200 | 200 |
201 #endif // CPU(ARM_NEON) && COMPILER(GCC) | 201 #endif // CPU(ARM_NEON) && COMPILER(GCC) |
202 | 202 |
203 #endif // FELightingNEON_h | 203 #endif // FELightingNEON_h |
OLD | NEW |