• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkAmbientShadowMaskFilter_DEFINED
9 #define SkAmbientShadowMaskFilter_DEFINED
10 
11 #include "SkMaskFilter.h"
12 #include "SkShadowFlags.h"
13 
14 /*
15  * This filter implements a shadow representing ambient occlusion for an occluding object.
16  */
17 class SK_API SkAmbientShadowMaskFilter {
18 public:
19     /** Create a shadow maskfilter.
20      *  @param occluderHeight Height of occluding object off of ground plane.
21      *  @param ambientAlpha   Base opacity of the ambient occlusion shadow.
22      *  @param flags          Flags to use - defaults to none
23      *  @return The new shadow maskfilter
24      */
25     static sk_sp<SkMaskFilter> Make(SkScalar occluderHeight, SkScalar ambientAlpha,
26                                     uint32_t flags = SkShadowFlags::kNone_ShadowFlag);
27 
28     SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
29 
30 private:
31     SkAmbientShadowMaskFilter(); // can't be instantiated
32 };
33 #endif
34