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

Unified Diff: src/core/SkLightingShader.cpp

Issue 2175563003: Bundle SkShader::asFragmentProcessor arguments in a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix indentation to be less arbitrary 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/SkComposeShader.cpp ('k') | src/core/SkLocalMatrixShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index b6b54967d58db307d9e30ac48184df5cc042ddc1..b478ee7eca29f0f73ed4d918badc245d380309be 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -53,11 +53,7 @@ public:
bool isOpaque() const override;
#if SK_SUPPORT_GPU
- sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*,
- const SkMatrix& viewM,
- const SkMatrix* localMatrix,
- SkFilterQuality,
- SkSourceGammaTreatment) const override;
+ sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const override;
#endif
class LightingShaderContext : public SkShader::Context {
@@ -265,23 +261,15 @@ private:
////////////////////////////////////////////////////////////////////////////
-sk_sp<GrFragmentProcessor> SkLightingShaderImpl::asFragmentProcessor(
- GrContext* context,
- const SkMatrix& viewM,
- const SkMatrix* localMatrix,
- SkFilterQuality filterQuality,
- SkSourceGammaTreatment gammaTreatment) const {
- sk_sp<GrFragmentProcessor> normalFP(
- fNormalSource->asFragmentProcessor(context, viewM, localMatrix, filterQuality,
- gammaTreatment));
+sk_sp<GrFragmentProcessor> SkLightingShaderImpl::asFragmentProcessor(const AsFPArgs& args) const {
+ sk_sp<GrFragmentProcessor> normalFP(fNormalSource->asFragmentProcessor(args));
if (!normalFP) {
return nullptr;
}
if (fDiffuseShader) {
sk_sp<GrFragmentProcessor> fpPipeline[] = {
- fDiffuseShader->asFragmentProcessor(context, viewM, localMatrix, filterQuality,
- gammaTreatment),
+ fDiffuseShader->asFragmentProcessor(args),
sk_make_sp<LightingFP>(std::move(normalFP), fLights)
};
if(!fpPipeline[0]) {
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkLocalMatrixShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698