Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: src/effects/SkLightingShader.h

Issue 1245883003: Move LightingShader to effects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address 64b gcc memory issues (seems to require more space than others) Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkBitmapProcState.h ('k') | src/effects/SkLightingShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2015 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10 #ifndef SkLightingShader_DEFINED
11 #define SkLightingShader_DEFINED
12
13 #include "SkPoint3.h"
14 #include "SkShader.h"
15
16 class SK_API SkLightingShader {
17 public:
18 struct Light {
19 SkVector3 fDirection; // direction towards the light (+Z is out of the screen).
20 // If degenerate, it will be replaced with (0, 0, 1).
21 SkColor fColor; // linear (unpremul) color. Note: alpha as sumed to be 255.
22 };
23
24 /** Returns a shader that lights the diffuse and normal maps with a single l ight.
25
26 It returns a shader with a reference count of 1.
27 The caller should decrement the shader's reference count when done with the shader.
28 It is an error for count to be < 2.
29 @param diffuse the diffuse bitmap
30 @param normal the normal map
31 @param light the light applied to the normal map
32 @param ambient the linear (unpremul) ambient light color. Note: alpha a ssumed to be 255.
33
34 NULL will be returned if:
35 either 'diffuse' or 'normal' are empty
36 either 'diffuse' or 'normal' are too big (> 65535 on a side)
37 'diffuse' and 'normal' aren't the same size
38 */
39 static SkShader* Create(const SkBitmap& diffuse, const SkBitmap& normal,
40 const SkLightingShader::Light& light, const SkColor ambient);
41
42 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
43 };
44
45 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcState.h ('k') | src/effects/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698