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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/SkLayerInfo.h ('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 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
11 #define SkLightingShader_DEFINED 11 #define SkLightingShader_DEFINED
12 12
13 #include "SkFlattenable.h" 13 #include "SkFlattenable.h"
14 #include "SkLight.h" 14 #include "SkLight.h"
15 #include "SkShader.h" 15 #include "SkShader.h"
16 #include "SkTDArray.h" 16 #include "SkTDArray.h"
17 17
18 class SkBitmap; 18 class SkBitmap;
19 class SkMatrix; 19 class SkMatrix;
20 20
21 class SK_API SkLightingShader { 21 class SK_API SkLightingShader {
22 public: 22 public:
23 class Lights : public SkRefCnt { 23 class Lights : public SkRefCnt {
24 public: 24 public:
25 class Builder { 25 class Builder {
26 public: 26 public:
27 Builder(const SkLight lights[], int numLights) 27 Builder(const SkLight lights[], int numLights)
28 : fLights(SkNEW_ARGS(Lights, (lights, numLights))) { 28 : fLights(new Lights(lights, numLights)) {}
29 }
30 29
31 Builder() : fLights(SkNEW(Lights)) { } 30 Builder() : fLights(new Lights) {}
32 31
33 // TODO: limit the number of lights here or just ignore those 32 // TODO: limit the number of lights here or just ignore those
34 // above some maximum? 33 // above some maximum?
35 void add(const SkLight& light) { 34 void add(const SkLight& light) {
36 if (fLights) { 35 if (fLights) {
37 *fLights->fLights.push() = light; 36 *fLights->fLights.push() = light;
38 } 37 }
39 } 38 }
40 39
41 const Lights* finish() { 40 const Lights* finish() {
42 return fLights.detach(); 41 return fLights.detach();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 (127, 127, 0). 91 (127, 127, 0).
93 */ 92 */
94 static SkShader* Create(const SkBitmap& diffuse, const SkBitmap& normal, 93 static SkShader* Create(const SkBitmap& diffuse, const SkBitmap& normal,
95 const Lights* lights, const SkVector& invNormRotatio n, 94 const Lights* lights, const SkVector& invNormRotatio n,
96 const SkMatrix* diffLocalMatrix, const SkMatrix* nor mLocalMatrix); 95 const SkMatrix* diffLocalMatrix, const SkMatrix* nor mLocalMatrix);
97 96
98 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 97 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
99 }; 98 };
100 99
101 #endif 100 #endif
OLDNEW
« no previous file with comments | « src/core/SkLayerInfo.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698