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

Unified Diff: src/core/SkBitmapProcShader.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/SkBitmapProcShader.h ('k') | src/core/SkColorFilterShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 8fad0b1fcc284d79b694882685492a4dfd39e467..406cc6f000758099e116f1175297fb60c97cd9c1 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -418,10 +418,7 @@ void SkBitmapProcShader::toString(SkString* str) const {
#include "SkGr.h"
#include "effects/GrSimpleTextureEffect.h"
-sk_sp<GrFragmentProcessor> SkBitmapProcShader::asFragmentProcessor(GrContext* context,
- const SkMatrix& viewM, const SkMatrix* localMatrix,
- SkFilterQuality filterQuality,
- SkSourceGammaTreatment gammaTreatment) const {
+sk_sp<GrFragmentProcessor> SkBitmapProcShader::asFragmentProcessor(const AsFPArgs& args) const {
SkMatrix matrix;
matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height());
@@ -429,9 +426,9 @@ sk_sp<GrFragmentProcessor> SkBitmapProcShader::asFragmentProcessor(GrContext* co
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);
@@ -449,11 +446,11 @@ sk_sp<GrFragmentProcessor> SkBitmapProcShader::asFragmentProcessor(GrContext* co
// 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(GrRefCachedBitmapTexture(context, fRawBitmap, params,
- gammaTreatment));
+ SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(args.fContext, fRawBitmap, params,
+ args.fGammaTreatment));
if (!texture) {
SkErrorInternals::SetError( kInternalError_SkError,
« no previous file with comments | « src/core/SkBitmapProcShader.h ('k') | src/core/SkColorFilterShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698