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

Side by Side Diff: src/core/SkLocalMatrixShader.cpp

Issue 2180503002: Add destination color space to AsFPArgs. Eliminates last XFORMTODO. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkBitmapProcShader.cpp ('k') | src/core/SkPictureShader.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 "SkLocalMatrixShader.h" 8 #include "SkLocalMatrixShader.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
11 #include "GrFragmentProcessor.h" 11 #include "GrFragmentProcessor.h"
12 #endif 12 #endif
13 13
14 #if SK_SUPPORT_GPU 14 #if SK_SUPPORT_GPU
15 sk_sp<GrFragmentProcessor> SkLocalMatrixShader::asFragmentProcessor(const AsFPAr gs& args) const { 15 sk_sp<GrFragmentProcessor> SkLocalMatrixShader::asFragmentProcessor(const AsFPAr gs& args) const {
16 SkMatrix tmp = this->getLocalMatrix(); 16 SkMatrix tmp = this->getLocalMatrix();
17 if (args.fLocalMatrix) { 17 if (args.fLocalMatrix) {
18 tmp.preConcat(*args.fLocalMatrix); 18 tmp.preConcat(*args.fLocalMatrix);
19 } 19 }
20 return fProxyShader->asFragmentProcessor(AsFPArgs( 20 return fProxyShader->asFragmentProcessor(AsFPArgs(
21 args.fContext, args.fViewMatrix, &tmp, args.fFilterQuality, args.fGammaT reatment)); 21 args.fContext, args.fViewMatrix, &tmp, args.fFilterQuality, args.fDstCol orSpace,
22 args.fGammaTreatment));
22 } 23 }
23 #endif 24 #endif
24 25
25 sk_sp<SkFlattenable> SkLocalMatrixShader::CreateProc(SkReadBuffer& buffer) { 26 sk_sp<SkFlattenable> SkLocalMatrixShader::CreateProc(SkReadBuffer& buffer) {
26 SkMatrix lm; 27 SkMatrix lm;
27 buffer.readMatrix(&lm); 28 buffer.readMatrix(&lm);
28 auto baseShader(buffer.readShader()); 29 auto baseShader(buffer.readShader());
29 if (!baseShader) { 30 if (!baseShader) {
30 return nullptr; 31 return nullptr;
31 } 32 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 SkMatrix otherLocalMatrix; 74 SkMatrix otherLocalMatrix;
74 SkAutoTUnref<SkShader> proxy(this->refAsALocalMatrixShader(&otherLocalMatrix )); 75 SkAutoTUnref<SkShader> proxy(this->refAsALocalMatrixShader(&otherLocalMatrix ));
75 if (proxy) { 76 if (proxy) {
76 otherLocalMatrix.preConcat(localMatrix); 77 otherLocalMatrix.preConcat(localMatrix);
77 lm = &otherLocalMatrix; 78 lm = &otherLocalMatrix;
78 baseShader = proxy.get(); 79 baseShader = proxy.get();
79 } 80 }
80 81
81 return sk_make_sp<SkLocalMatrixShader>(baseShader, *lm); 82 return sk_make_sp<SkLocalMatrixShader>(baseShader, *lm);
82 } 83 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698