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

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: Removed setDir() and re-added resizing shadow maps 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 LightType type() const { return fType; } 55 LightType type() const { return fType; }
56 const SkColor3f& color() const { return fColor; } 56 const SkColor3f& color() const { return fColor; }
57 const SkVector3& dir() const { 57 const SkVector3& dir() const {
58 SkASSERT(kAmbient_LightType != fType); 58 SkASSERT(kAmbient_LightType != fType);
59 return fDirection; 59 return fDirection;
60 } 60 }
61 61
62 void setShadowMap(sk_sp<SkImage> shadowMap) { 62 void setShadowMap(sk_sp<SkImage> shadowMap) {
63 fShadowMap = std::move(shadowMap); 63 fShadowMap = std::move(shadowMap);
64 } 64 }
65 65
robertphillips 2016/08/03 18:47:47 For better or for worse, Skia doesn't usually retu
vjiaoblack 2016/08/04 13:36:21 Ah. That must've been why this change was made,
66 SkImage* getShadowMap() const { 66 sk_sp<SkImage> getShadowMap() const {
67 return fShadowMap.get(); 67 return fShadowMap;
68 } 68 }
69 69
70 Light& operator= (const Light& b) { 70 Light& operator= (const Light& b) {
71 if (this == &b) { 71 if (this == &b) {
72 return *this; 72 return *this;
73 } 73 }
74 74
75 fColor = b.fColor; 75 fColor = b.fColor;
76 fType = b.fType; 76 fType = b.fType;
77 fDirection = b.fDirection; 77 fDirection = b.fDirection;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 private: 126 private:
127 SkLights() {} 127 SkLights() {}
128 128
129 SkTArray<Light> fLights; 129 SkTArray<Light> fLights;
130 130
131 typedef SkRefCnt INHERITED; 131 typedef SkRefCnt INHERITED;
132 }; 132 };
133 133
134 #endif 134 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698