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

Side by Side Diff: include/gpu/GrEffectStage.h

Issue 509153002: Initial change to create GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixing mac compiler warning Created 6 years, 3 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
11 #ifndef GrEffectStage_DEFINED 11 #ifndef GrEffectStage_DEFINED
12 #define GrEffectStage_DEFINED 12 #define GrEffectStage_DEFINED
13 13
14 #include "GrBackendEffectFactory.h" 14 #include "GrBackendEffectFactory.h"
15 #include "GrEffect.h" 15 #include "GrEffect.h"
16 #include "SkMatrix.h" 16 #include "SkMatrix.h"
17 #include "GrTypes.h" 17 #include "GrTypes.h"
18 18
19 #include "SkShader.h" 19 #include "SkShader.h"
20 20
21 class GrEffectStage { 21 class GrEffectStage : public SkRefCnt {
22 public: 22 public:
23 SK_DECLARE_INST_COUNT(GrEffectStage);
24
23 explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attr Index1 = -1) 25 explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attr Index1 = -1)
24 : fEffect(SkRef(effect)) { 26 : fEffect(SkRef(effect)) {
25 fCoordChangeMatrixSet = false; 27 fCoordChangeMatrixSet = false;
26 fVertexAttribIndices[0] = attrIndex0; 28 fVertexAttribIndices[0] = attrIndex0;
27 fVertexAttribIndices[1] = attrIndex1; 29 fVertexAttribIndices[1] = attrIndex1;
28 } 30 }
29 31
robertphillips 2014/08/29 15:04:53 We don't usually add the explicit empty INHERITED(
joshua.litt 2014/09/02 16:06:21 Well, if I don't do this then I get a warning on m
30 GrEffectStage(const GrEffectStage& other) { 32 GrEffectStage(const GrEffectStage& other) : INHERITED() {
bsalomon 2014/08/29 15:07:25 We don't require explicit calls of default cons fo
joshua.litt 2014/09/02 16:06:21 see above
31 *this = other; 33 *this = other;
32 } 34 }
33 35
34 GrEffectStage& operator= (const GrEffectStage& other) { 36 GrEffectStage& operator= (const GrEffectStage& other) {
35 fCoordChangeMatrixSet = other.fCoordChangeMatrixSet; 37 fCoordChangeMatrixSet = other.fCoordChangeMatrixSet;
36 if (other.fCoordChangeMatrixSet) { 38 if (other.fCoordChangeMatrixSet) {
37 fCoordChangeMatrix = other.fCoordChangeMatrix; 39 fCoordChangeMatrix = other.fCoordChangeMatrix;
38 } 40 }
39 fEffect.reset(SkRef(other.fEffect.get())); 41 fEffect.reset(SkRef(other.fEffect.get()));
40 memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexA ttribIndices)); 42 memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexA ttribIndices));
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 const GrEffect* getEffect() const { return fEffect.get(); } 136 const GrEffect* getEffect() const { return fEffect.get(); }
135 137
136 const int* getVertexAttribIndices() const { return fVertexAttribIndices; } 138 const int* getVertexAttribIndices() const { return fVertexAttribIndices; }
137 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs(); } 139 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs(); }
138 140
139 private: 141 private:
140 bool fCoordChangeMatrixSet; 142 bool fCoordChangeMatrixSet;
141 SkMatrix fCoordChangeMatrix; 143 SkMatrix fCoordChangeMatrix;
142 SkAutoTUnref<const GrEffect> fEffect; 144 SkAutoTUnref<const GrEffect> fEffect;
143 int fVertexAttribIndices[2]; 145 int fVertexAttribIndices[2];
146
147 typedef SkRefCnt INHERITED;
144 }; 148 };
145 149
146 #endif 150 #endif
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698