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

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: 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 2a090b78e2a2c097c41ee34d21f2e93831c7689c..734cb823f4726af2b7cb3164f27c694e64074aef 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);
int dMapWidth = SkMin32(maxDepth * fabs(light.dir().fX) + width,
width * 2);
int dMapHeight = SkMin32(maxDepth * fabs(light.dir().fY) + height,
@@ -75,13 +74,11 @@ 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::kAmbient_LightType) {
- const SkVector3& lightDir = this->fLights->light(0).dir();
- SkScalar x = lightDir.fX * this->getZ();
- SkScalar y = lightDir.fY * this->getZ();
+ const SkVector3& lightDir = this->fLights->light(0).dir();
+ SkScalar x = lightDir.fX * this->getZ();
+ SkScalar y = lightDir.fY * this->getZ();
- this->translate(x, y);
- }
+ this->translate(x, y);
}
void SkShadowPaintFilterCanvas::onDrawPaint(const SkPaint &paint) {
« 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