blob: 163d58acd7638f444d6937e4b2402634b91d50bd [file] [log] [blame]
vjiaoblack53da5ba2016-08-01 10:02:31 -07001/*
2 * Copyright 2016 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
9#ifndef SkShadowShader_DEFINED
10#define SkShadowShader_DEFINED
11
12#ifdef SK_EXPERIMENTAL_SHADOWING
13
14class SkLights;
15class SkShader;
16
17class SK_API SkShadowShader {
18public:
19 /** This shader combines the diffuse color in 'diffuseShader' with the shadows
20 * determined by the 'povDepthShader' and the shadow maps stored in each of the
21 * lights in 'lights'
22 */
23 static sk_sp<SkShader> Make(sk_sp<SkShader> povDepthShader,
24 sk_sp<SkShader> diffuseShader,
25 sk_sp<SkLights> lights,
26 int diffuseWidth, int diffuseHeight);
27
vjiaoblack955e8792016-08-05 07:55:01 -070028 // The shadow shader supports any number of ambient lights, but only
29 // 4 non-ambient lights (currently just refers to directional lights).
30 static constexpr int kMaxNonAmbientLights = 4;
31
vjiaoblack53da5ba2016-08-01 10:02:31 -070032 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
33};
34
35#endif
36#endif