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

Unified Diff: src/image/SkImageShader.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/image/SkImageShader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.cpp
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index 77639b21c74587bd051d2c949baa164a13fef62a..e7a8433fe24d895745f33a639480be626b0124b8 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -83,12 +83,7 @@ void SkImageShader::toString(SkString* str) const {
#include "effects/GrBicubicEffect.h"
#include "effects/GrSimpleTextureEffect.h"
-sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
- GrContext* context,
- const SkMatrix& viewM,
- const SkMatrix* localMatrix,
- SkFilterQuality filterQuality,
- SkSourceGammaTreatment gammaTreatment) const {
+sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& args) const {
SkMatrix matrix;
matrix.setIDiv(fImage->width(), fImage->height());
@@ -96,9 +91,9 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
if (!this->getLocalMatrix().invert(&lmInverse)) {
return nullptr;
}
- if (localMatrix) {
+ if (args.fLocalMatrix) {
SkMatrix inv;
- if (!localMatrix->invert(&inv)) {
+ if (!args.fLocalMatrix->invert(&inv)) {
return nullptr;
}
lmInverse.postConcat(inv);
@@ -113,9 +108,11 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
// are provided by the caller.
bool doBicubic;
GrTextureParams::FilterMode textureFilterMode =
- GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix(), &doBicubic);
+ GrSkFilterQualityToGrFilterMode(args.fFilterQuality, *args.fViewMatrix, this->getLocalMatrix(),
+ &doBicubic);
GrTextureParams params(tm, textureFilterMode);
- SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params, gammaTreatment));
+ SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(args.fContext, params,
+ args.fGammaTreatment));
if (!texture) {
return nullptr;
}
« no previous file with comments | « src/image/SkImageShader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698