@@ -50,16 +50,8 @@ void PhysicalModelLayer::Paint(PaintContext& context) {
50
50
path.addRRect (rrect_);
51
51
52
52
if (elevation_ != 0 ) {
53
- SkShadowFlags flags = SkColorGetA (color_) == 0xff ?
54
- SkShadowFlags::kNone_ShadowFlag :
55
- SkShadowFlags::kTransparentOccluder_ShadowFlag ;
56
- SkShadowUtils::DrawShadow (&context.canvas , path,
57
- elevation_ * 4 ,
58
- SkPoint3::Make (0 .0f , -700 .0f , 2800 .0f ),
59
- 2800 .0f ,
60
- 0 .25f , 0 .25f ,
61
- SK_ColorBLACK,
62
- flags);
53
+ DrawShadow (&context.canvas , path, SK_ColorBLACK, elevation_,
54
+ SkColorGetA (color_) != 0xff );
63
55
}
64
56
65
57
if (needs_system_composite ())
@@ -79,4 +71,19 @@ void PhysicalModelLayer::Paint(PaintContext& context) {
79
71
PaintChildren (context);
80
72
}
81
73
74
+ void PhysicalModelLayer::DrawShadow (SkCanvas* canvas, const SkPath& path,
75
+ SkColor color, int elevation,
76
+ bool transparentOccluder) {
77
+ SkShadowFlags flags = transparentOccluder ?
78
+ SkShadowFlags::kTransparentOccluder_ShadowFlag :
79
+ SkShadowFlags::kNone_ShadowFlag ;
80
+ SkShadowUtils::DrawShadow (canvas, path,
81
+ elevation * 4 ,
82
+ SkPoint3::Make (0 .0f , -700 .0f , 2800 .0f ),
83
+ 2800 .0f ,
84
+ 0 .25f , 0 .25f ,
85
+ color,
86
+ flags);
87
+ }
88
+
82
89
} // namespace flow
0 commit comments