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

Side by Side Diff: src/gpu/GrDrawState.h

Issue 12379052: Remove constructors from GrVertexAttrib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 GrDrawState_DEFINED 8 #ifndef GrDrawState_DEFINED
9 #define GrDrawState_DEFINED 9 #define GrDrawState_DEFINED
10 10
(...skipping 20 matching lines...) Expand all
31 kVec2f_GrVertexAttribType, 31 kVec2f_GrVertexAttribType,
32 kVec3f_GrVertexAttribType, 32 kVec3f_GrVertexAttribType,
33 kVec4f_GrVertexAttribType, 33 kVec4f_GrVertexAttribType,
34 kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors 34 kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors
35 35
36 kLast_GrVertexAttribType = kVec4ub_GrVertexAttribType 36 kLast_GrVertexAttribType = kVec4ub_GrVertexAttribType
37 }; 37 };
38 static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; 38 static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
39 39
40 struct GrVertexAttrib { 40 struct GrVertexAttrib {
41 inline GrVertexAttrib() {} 41 inline void set(GrVertexAttribType type, size_t offset) {
42 inline GrVertexAttrib(GrVertexAttribType type, size_t offset) : 42 fType = type; fOffset = offset;
43 fType(type), fOffset(offset) {} 43 }
44 bool operator==(const GrVertexAttrib& other) const { 44 bool operator==(const GrVertexAttrib& other) const {
45 return fType == other.fType && fOffset == other.fOffset; 45 return fType == other.fType && fOffset == other.fOffset;
46 }; 46 };
47 bool operator!=(const GrVertexAttrib& other) const { return !(*this == other ); } 47 bool operator!=(const GrVertexAttrib& other) const { return !(*this == other ); }
48 48
49 GrVertexAttribType fType; 49 GrVertexAttribType fType;
50 size_t fOffset; 50 size_t fOffset;
51 }; 51 };
52 52
53 template <int N> 53 template <int N>
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 int fAttribIndices[kAttribIndexCount]; 1370 int fAttribIndices[kAttribIndexCount];
1371 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; 1371 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs;
1372 GrEffectStage fStages[kNumStages]; 1372 GrEffectStage fStages[kNumStages];
1373 1373
1374 typedef GrRefCnt INHERITED; 1374 typedef GrRefCnt INHERITED;
1375 }; 1375 };
1376 1376
1377 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); 1377 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags);
1378 1378
1379 #endif 1379 #endif
OLDNEW
« src/gpu/GrContext.cpp ('K') | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698