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

Unified Diff: src/utils/SkShadowPaintFilterCanvas.cpp

Issue 2287553002: Moved ambient lights out of SkLight's light array (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: made req changes 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 side-by-side diff with in-line comments
Download patch
« src/core/SkShadowShader.cpp ('K') | « src/core/SkShadowShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkShadowPaintFilterCanvas.cpp
diff --git a/src/utils/SkShadowPaintFilterCanvas.cpp b/src/utils/SkShadowPaintFilterCanvas.cpp
index e4308709edf49ed0bd7f1c4734f0a0c1b8abfc54..e122db5060c909b92b4336489bd2836a53e88668 100644
--- a/src/utils/SkShadowPaintFilterCanvas.cpp
+++ b/src/utils/SkShadowPaintFilterCanvas.cpp
@@ -50,7 +50,6 @@ bool SkShadowPaintFilterCanvas::onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, Ty
SkISize SkShadowPaintFilterCanvas::ComputeDepthMapSize(const SkLights::Light& light, int maxDepth,
int width, int height) {
- SkASSERT(light.type() != SkLights::Light::kAmbient_LightType);
if (light.type() != SkLights::Light::kDirectional_LightType) {
return SkISize::Make(width *2 , height * 2);
}
@@ -79,7 +78,7 @@ void SkShadowPaintFilterCanvas::updateMatrix() {
// It is up to the user to set the 0th light in fLights to
// the light the want to render the depth map with.
- if (this->fLights->light(0).type() == SkLights::Light::kDirectional_LightType) {
+ if (SkLights::Light::kDirectional_LightType == this->fLights->light(0).type()) {
robertphillips 2016/08/26 19:16:02 This test was actually fine the way it was b.c. ".
vjiaoblack 2016/08/26 19:25:17 Acknowledged.
const SkVector3& lightDir = this->fLights->light(0).dir();
SkScalar x = lightDir.fX * this->getZ();
SkScalar y = lightDir.fY * this->getZ();
« src/core/SkShadowShader.cpp ('K') | « src/core/SkShadowShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698