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

Unified Diff: src/core/SkNormalSource.cpp

Issue 2062703003: Abstracted diffuse color map out of SkLightingShaderImpl into a generic SkShader (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-normal-api-change
Patch Set: Nullptr returns now propagate through fragment processor creation chain Created 4 years, 5 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
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalSource.cpp
diff --git a/src/core/SkNormalSource.cpp b/src/core/SkNormalSource.cpp
index 52bb4adaa70092504a58bc4f17ecd825f6b4988a..a69367921263ccdd8d1f2f793d35bc3923c6deef 100644
--- a/src/core/SkNormalSource.cpp
+++ b/src/core/SkNormalSource.cpp
@@ -181,9 +181,11 @@ sk_sp<GrFragmentProcessor> NormalMapSourceImpl::asFragmentProcessor(
const SkMatrix *localMatrix,
SkFilterQuality filterQuality,
SkSourceGammaTreatment gammaTreatment) const {
-
sk_sp<GrFragmentProcessor> mapFP = fMapShader->asFragmentProcessor(context, viewM,
localMatrix, filterQuality, gammaTreatment);
+ if (!mapFP) {
+ return nullptr;
+ }
return sk_make_sp<NormalMapFP>(std::move(mapFP), fInvCTM);
}
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698