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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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/SkImageCacherator.cpp ('k') | src/core/SkPictureData.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 9
10 #ifndef SkLightingShader_DEFINED 10 #ifndef SkLightingShader_DEFINED
(...skipping 20 matching lines...) Expand all
31 31
32 // TODO: limit the number of lights here or just ignore those 32 // TODO: limit the number of lights here or just ignore those
33 // above some maximum? 33 // above some maximum?
34 void add(const SkLight& light) { 34 void add(const SkLight& light) {
35 if (fLights) { 35 if (fLights) {
36 *fLights->fLights.push() = light; 36 *fLights->fLights.push() = light;
37 } 37 }
38 } 38 }
39 39
40 const Lights* finish() { 40 const Lights* finish() {
41 return fLights.detach(); 41 return fLights.release();
42 } 42 }
43 43
44 private: 44 private:
45 SkAutoTUnref<Lights> fLights; 45 SkAutoTUnref<Lights> fLights;
46 }; 46 };
47 47
48 int numLights() const { 48 int numLights() const {
49 return fLights.count(); 49 return fLights.count();
50 } 50 }
51 51
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 (127, 127, 0). 91 (127, 127, 0).
92 */ 92 */
93 static SkShader* Create(const SkBitmap& diffuse, const SkBitmap& normal, 93 static SkShader* Create(const SkBitmap& diffuse, const SkBitmap& normal,
94 const Lights* lights, const SkVector& invNormRotatio n, 94 const Lights* lights, const SkVector& invNormRotatio n,
95 const SkMatrix* diffLocalMatrix, const SkMatrix* nor mLocalMatrix); 95 const SkMatrix* diffLocalMatrix, const SkMatrix* nor mLocalMatrix);
96 96
97 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 97 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
98 }; 98 };
99 99
100 #endif 100 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698