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

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

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 Created 4 years, 8 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/SkBlitter.cpp ('k') | src/core/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
1
2 /* 1 /*
3 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
4 * 3 *
5 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9
10 #ifndef SkLightingShader_DEFINED 8 #ifndef SkLightingShader_DEFINED
11 #define SkLightingShader_DEFINED 9 #define SkLightingShader_DEFINED
12 10
13 #include "SkFlattenable.h" 11 #include "SkFlattenable.h"
14 #include "SkLight.h" 12 #include "SkLight.h"
15 #include "SkShader.h" 13 #include "SkShader.h"
16 #include "SkTDArray.h" 14 #include "SkTDArray.h"
17 15
18 class SkBitmap; 16 class SkBitmap;
19 class SkMatrix; 17 class SkMatrix;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 81
84 The normal map is currently assumed to be an 8888 image where the normal at a texel 82 The normal map is currently assumed to be an 8888 image where the normal at a texel
85 is retrieved by: 83 is retrieved by:
86 N.x = R-127; 84 N.x = R-127;
87 N.y = G-127; 85 N.y = G-127;
88 N.z = B-127; 86 N.z = B-127;
89 N.normalize(); 87 N.normalize();
90 The +Z axis is thus encoded in RGB as (127, 127, 255) while the -Z axis is 88 The +Z axis is thus encoded in RGB as (127, 127, 255) while the -Z axis is
91 (127, 127, 0). 89 (127, 127, 0).
92 */ 90 */
93 static SkShader* Create(const SkBitmap& diffuse, const SkBitmap& normal, 91 static sk_sp<SkShader> Make(const SkBitmap& diffuse, const SkBitmap& normal,
94 const Lights* lights, const SkVector& invNormRotatio n, 92 const Lights* lights, const SkVector& invNormRot ation,
95 const SkMatrix* diffLocalMatrix, const SkMatrix* nor mLocalMatrix); 93 const SkMatrix* diffLocalMatrix, const SkMatrix* normLocalMatrix);
96 94
97 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 95 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
98 }; 96 };
99 97
100 #endif 98 #endif
OLDNEW
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698