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

Side by Side Diff: gm/lightingshader.cpp

Issue 2291663002: Revert of Moved ambient lights out of SkLight's light array (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 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 | « no previous file | gm/lightingshader2.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkLightingShader.h" 9 #include "SkLightingShader.h"
10 #include "SkNormalSource.h" 10 #include "SkNormalSource.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 public: 45 public:
46 LightingShaderGM() { 46 LightingShaderGM() {
47 this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC)); 47 this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC));
48 48
49 SkLights::Builder builder; 49 SkLights::Builder builder;
50 50
51 builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(1.0f, 1.0f, 1.0f), 51 builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(1.0f, 1.0f, 1.0f),
52 SkVector3::Make(SK_ScalarRo ot2Over2, 52 SkVector3::Make(SK_ScalarRo ot2Over2,
53 0.0f, 53 0.0f,
54 SK_ScalarRo ot2Over2))); 54 SK_ScalarRo ot2Over2)));
55 builder.setAmbientLightColor(SkColor3f::Make(0.2f, 0.2f, 0.2f)); 55 builder.add(SkLights::Light::MakeAmbient(SkColor3f::Make(0.2f, 0.2f, 0.2 f)));
56 56
57 fLights = builder.finish(); 57 fLights = builder.finish();
58 } 58 }
59 59
60 protected: 60 protected:
61 enum NormalMap { 61 enum NormalMap {
62 kHemi_NormalMap, 62 kHemi_NormalMap,
63 kFrustum_NormalMap, 63 kFrustum_NormalMap,
64 kTetra_NormalMap, 64 kTetra_NormalMap,
65 65
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 sk_sp<SkLights> fLights; 173 sk_sp<SkLights> fLights;
174 174
175 typedef GM INHERITED; 175 typedef GM INHERITED;
176 }; 176 };
177 177
178 ////////////////////////////////////////////////////////////////////////////// 178 //////////////////////////////////////////////////////////////////////////////
179 179
180 DEF_GM(return new LightingShaderGM;) 180 DEF_GM(return new LightingShaderGM;)
181 } 181 }
OLDNEW
« no previous file with comments | « no previous file | gm/lightingshader2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698