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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPictureShader.h ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPictureShader.h" 8 #include "SkPictureShader.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 fPicture->cullRect().fRight, 311 fPicture->cullRect().fRight,
312 fPicture->cullRect().fBottom); 312 fPicture->cullRect().fBottom);
313 313
314 str->appendf("(%s, %s)", gTileModeName[fTmx], gTileModeName[fTmy]); 314 str->appendf("(%s, %s)", gTileModeName[fTmx], gTileModeName[fTmy]);
315 315
316 this->INHERITED::toString(str); 316 this->INHERITED::toString(str);
317 } 317 }
318 #endif 318 #endif
319 319
320 #if SK_SUPPORT_GPU 320 #if SK_SUPPORT_GPU
321 sk_sp<GrFragmentProcessor> SkPictureShader::asFragmentProcessor( 321 sk_sp<GrFragmentProcessor> SkPictureShader::asFragmentProcessor(const AsFPArgs& args) const {
322 GrContext* context, const S kMatrix& viewM,
323 const SkMatrix* localMatrix ,
324 SkFilterQuality fq,
325 SkSourceGammaTreatment gamm aTreatment) const {
326 int maxTextureSize = 0; 322 int maxTextureSize = 0;
327 if (context) { 323 if (args.fContext) {
328 maxTextureSize = context->caps()->maxTextureSize(); 324 maxTextureSize = args.fContext->caps()->maxTextureSize();
329 } 325 }
330 sk_sp<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix, maxTe xtureSize)); 326 sk_sp<SkShader> bitmapShader(this->refBitmapShader(*args.fViewMatrix, args.f LocalMatrix,
327 maxTextureSize));
331 if (!bitmapShader) { 328 if (!bitmapShader) {
332 return nullptr; 329 return nullptr;
333 } 330 }
334 return bitmapShader->asFragmentProcessor(context, viewM, nullptr, fq, gammaT reatment); 331 return bitmapShader->asFragmentProcessor(SkShader::AsFPArgs(
332 args.fContext, args.fViewMatrix, nullptr, args.fFilterQuality, args.fGam maTreatment));
335 } 333 }
336 #endif 334 #endif
OLDNEW
« 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