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

Side by Side Diff: include/core/SkLights.h

Issue 2198933002: Making a sample for shadow maps for more intensive development (Closed) Base URL: https://skia.googlesource.com/skia@shadow-gm
Patch Set: undo change Created 4 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkLights_DEFINED 9 #ifndef SkLights_DEFINED
10 #define SkLights_DEFINED 10 #define SkLights_DEFINED
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return fDirection; 47 return fDirection;
48 } 48 }
49 49
50 void setShadowMap(sk_sp<SkImage> shadowMap) { 50 void setShadowMap(sk_sp<SkImage> shadowMap) {
51 fShadowMap = std::move(shadowMap); 51 fShadowMap = std::move(shadowMap);
52 } 52 }
53 53
54 sk_sp<SkImage> getShadowMap() const { 54 sk_sp<SkImage> getShadowMap() const {
55 return fShadowMap; 55 return fShadowMap;
56 } 56 }
57 57
robertphillips 2016/08/02 16:05:06 The entire idea of having the builder and then bui
vjiaoblack 2016/08/03 14:04:20 Done.
58 void setDir(SkVector3 newDir) {
59 fDirection = newDir;
60 if (!fDirection.normalize()) {
61 fDirection.set(0.0f, 0.0f, 1.0f);
62 }
63 }
64
58 Light& operator= (const Light& b) { 65 Light& operator= (const Light& b) {
59 if (this == &b) 66 if (this == &b)
60 return *this; 67 return *this;
61 68
62 this->fColor = b.fColor; 69 this->fColor = b.fColor;
63 this->fType = b.fType; 70 this->fType = b.fType;
64 this->fDirection = b.fDirection; 71 this->fDirection = b.fDirection;
65 72
66 if (b.fShadowMap) { 73 if (b.fShadowMap) {
67 this->fShadowMap = b.fShadowMap; 74 this->fShadowMap = b.fShadowMap;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return fLights[index]; 115 return fLights[index];
109 } 116 }
110 117
111 private: 118 private:
112 SkLights() {} 119 SkLights() {}
113 120
114 SkTDArray<Light> fLights; 121 SkTDArray<Light> fLights;
115 }; 122 };
116 123
117 #endif 124 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698