@@ -143,7 +143,7 @@ float heightFunc(float x, float y) {
143
143
public static void drawShadow ( Canvas canvas , Path path , Vector3 zPlaneParams , Vector3 devLightPos ,
144
144
float lightRadius , uiColor ambientColor , uiColor spotColor , int flags ) {
145
145
if ( kUseFastShadow ) {
146
- drawShadowFull2 ( canvas , path , zPlaneParams , devLightPos , lightRadius , ambientColor , spotColor , flags ) ;
146
+ drawShadowFast ( canvas , path , zPlaneParams , devLightPos , lightRadius , ambientColor , spotColor , flags ) ;
147
147
}
148
148
else {
149
149
drawShadowFull ( canvas , path , zPlaneParams , devLightPos , lightRadius , ambientColor , spotColor , flags ) ;
@@ -204,7 +204,7 @@ static void drawShadowFull(Canvas canvas, Path path, Vector3 zPlaneParams, Vecto
204
204
}
205
205
206
206
207
- static void drawShadowFull2 ( Canvas canvas , Path path , Vector3 zPlaneParams , Vector3 devLightPos ,
207
+ static void drawShadowFast ( Canvas canvas , Path path , Vector3 zPlaneParams , Vector3 devLightPos ,
208
208
float lightRadius , uiColor ambientColor , uiColor spotColor , int flags ) {
209
209
Matrix3 viewMatrix = canvas . getTotalMatrix ( ) ;
210
210
@@ -253,39 +253,6 @@ static void drawShadowFull2(Canvas canvas, Path path, Vector3 zPlaneParams, Vect
253
253
254
254
_shadowPaint . maskFilter = null ;
255
255
}
256
-
257
- static void drawShadowFast ( Canvas canvas , Path path , Vector3 zPlaneParams , Vector3 devLightPos ,
258
- float lightRadius , uiColor ambientColor , uiColor spotColor , int flags ) {
259
- Matrix3 viewMatrix = canvas . getTotalMatrix ( ) ;
260
-
261
- //ambient light
262
- float devSpaceOutset = ambientBlurRadius ( zPlaneParams . z ) ;
263
- float oneOverA = ambientRecipAlpha ( zPlaneParams . z ) ;
264
- float blurRadius = 0.5f * devSpaceOutset * oneOverA ;
265
- float strokeWidth = 0.5f * ( devSpaceOutset - blurRadius ) ;
266
-
267
- _shadowPaint . color = new Color ( ambientColor . value ) ;
268
- _shadowPaint . strokeWidth = strokeWidth ;
269
- _shadowPaint . style = PaintingStyle . fill ;
270
- canvas . drawPath ( path , _shadowPaint ) ;
271
-
272
- //spot light
273
- float radius = 0.0f ;
274
-
275
- if ( ! getSpotShadowTransform ( devLightPos , lightRadius , viewMatrix , zPlaneParams , path . getBounds ( ) ,
276
- _shadowMatrix , ref radius ) ) {
277
- return ;
278
- }
279
-
280
- canvas . save ( ) ;
281
- canvas . setMatrix ( _shadowMatrix ) ;
282
- _shadowPaint . color = new Color ( spotColor . value ) ;
283
- _shadowPaint . strokeWidth = 0 ;
284
- _shadowPaint . style = PaintingStyle . fill ;
285
- canvas . drawPath ( path , _shadowPaint ) ;
286
-
287
- canvas . restore ( ) ;
288
- }
289
256
290
257
/*
291
258
* Check whether the RRect is a naive Round-Rect, of which
0 commit comments