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

Unified Diff: src/core/SkPictureShader.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/SkPictureShader.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureShader.cpp
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index a6186e6c7db57d81813effbc250d3e586d860b1b..1b1189c20d92fdd42e5dc867530da41fa3541f17 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -318,19 +318,17 @@ void SkPictureShader::toString(SkString* str) const {
#endif
#if SK_SUPPORT_GPU
-sk_sp<GrFragmentProcessor> SkPictureShader::asFragmentProcessor(
- GrContext* context, const SkMatrix& viewM,
- const SkMatrix* localMatrix,
- SkFilterQuality fq,
- SkSourceGammaTreatment gammaTreatment) const {
+sk_sp<GrFragmentProcessor> SkPictureShader::asFragmentProcessor(const AsFPArgs& args) const {
int maxTextureSize = 0;
- if (context) {
- maxTextureSize = context->caps()->maxTextureSize();
+ if (args.fContext) {
+ maxTextureSize = args.fContext->caps()->maxTextureSize();
}
- sk_sp<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix, maxTextureSize));
+ sk_sp<SkShader> bitmapShader(this->refBitmapShader(*args.fViewMatrix, args.fLocalMatrix,
+ maxTextureSize));
if (!bitmapShader) {
return nullptr;
}
- return bitmapShader->asFragmentProcessor(context, viewM, nullptr, fq, gammaTreatment);
+ return bitmapShader->asFragmentProcessor(SkShader::AsFPArgs(
+ args.fContext, args.fViewMatrix, nullptr, args.fFilterQuality, args.fGammaTreatment));
}
#endif
« no previous file with comments | « src/core/SkPictureShader.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698