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

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

Issue 2026393005: Add SampleApp slide with animating lightmapped objects & transparency (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 4 years, 6 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 | « gyp/SampleApp.gyp ('k') | samplecode/SampleLitAtlas.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 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 class Builder { 54 class Builder {
55 public: 55 public:
56 Builder() : fLights(new SkLights) { } 56 Builder() : fLights(new SkLights) { }
57 57
58 void add(const Light& light) { 58 void add(const Light& light) {
59 if (fLights) { 59 if (fLights) {
60 *fLights->fLights.push() = light; 60 *fLights->fLights.push() = light;
61 } 61 }
62 } 62 }
63 63
64 const sk_sp<SkLights> finish() { 64 sk_sp<SkLights> finish() {
65 return fLights; 65 return fLights;
66 } 66 }
67 67
68 private: 68 private:
69 sk_sp<SkLights> fLights; 69 sk_sp<SkLights> fLights;
70 }; 70 };
71 71
72 int numLights() const { 72 int numLights() const {
73 return fLights.count(); 73 return fLights.count();
74 } 74 }
75 75
76 const Light& light(int index) const { 76 const Light& light(int index) const {
77 return fLights[index]; 77 return fLights[index];
78 } 78 }
79 79
80 private: 80 private:
81 SkLights() {} 81 SkLights() {}
82 82
83 SkTDArray<Light> fLights; 83 SkTDArray<Light> fLights;
84 }; 84 };
85 85
86 #endif 86 #endif
OLDNEW
« no previous file with comments | « gyp/SampleApp.gyp ('k') | samplecode/SampleLitAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698