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

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

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/SkLightingShader.cpp ('k') | src/core/SkLocalMatrixShader.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 #ifndef SkLocalMatrixShader_DEFINED 8 #ifndef SkLocalMatrixShader_DEFINED
9 #define SkLocalMatrixShader_DEFINED 9 #define SkLocalMatrixShader_DEFINED
10 10
11 #include "SkShader.h" 11 #include "SkShader.h"
12 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 14
15 class GrFragmentProcessor; 15 class GrFragmentProcessor;
16 16
17 class SkLocalMatrixShader : public SkShader { 17 class SkLocalMatrixShader : public SkShader {
18 public: 18 public:
19 SkLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix) 19 SkLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix)
20 : INHERITED(&localMatrix) 20 : INHERITED(&localMatrix)
21 , fProxyShader(SkRef(proxy)) 21 , fProxyShader(SkRef(proxy))
22 {} 22 {}
23 23
24 GradientType asAGradient(GradientInfo* info) const override { 24 GradientType asAGradient(GradientInfo* info) const override {
25 return fProxyShader->asAGradient(info); 25 return fProxyShader->asAGradient(info);
26 } 26 }
27 27
28 #if SK_SUPPORT_GPU 28 #if SK_SUPPORT_GPU
29 sk_sp<GrFragmentProcessor> asFragmentProcessor( 29 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri de;
30 GrContext* context, const SkMatrix& viewM,
31 const SkMatrix* localMatrix, SkFilte rQuality fq,
32 SkSourceGammaTreatment gammaTreatmen t) const override;
33 #endif 30 #endif
34 31
35 SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const override { 32 SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const override {
36 if (localMatrix) { 33 if (localMatrix) {
37 *localMatrix = this->getLocalMatrix(); 34 *localMatrix = this->getLocalMatrix();
38 } 35 }
39 return SkRef(fProxyShader.get()); 36 return SkRef(fProxyShader.get());
40 } 37 }
41 38
42 SK_TO_STRING_OVERRIDE() 39 SK_TO_STRING_OVERRIDE()
(...skipping 11 matching lines...) Expand all
54 return fProxyShader->isABitmap(bitmap, matrix, mode); 51 return fProxyShader->isABitmap(bitmap, matrix, mode);
55 } 52 }
56 53
57 private: 54 private:
58 SkAutoTUnref<SkShader> fProxyShader; 55 SkAutoTUnref<SkShader> fProxyShader;
59 56
60 typedef SkShader INHERITED; 57 typedef SkShader INHERITED;
61 }; 58 };
62 59
63 #endif 60 #endif
OLDNEW
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698