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

Unified Diff: include/gpu/GrTypesPriv.h

Issue 12942014: Move GrGLProgram::Desc out of GrGLProgram. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Move #include below dbl include check 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 side-by-side diff with in-line comments
Download patch
Index: include/gpu/GrTypesPriv.h
===================================================================
--- include/gpu/GrTypesPriv.h (revision 8407)
+++ include/gpu/GrTypesPriv.h (working copy)
@@ -8,6 +8,8 @@
#ifndef GrTypesPriv_DEFINED
#define GrTypesPriv_DEFINED
+#include "SkTArray.h"
+
/**
* Types of shader-language-specific boxed variables we can create.
* (Currently only GrGLShaderVars, but should be applicable to other shader
@@ -24,4 +26,34 @@
kSampler2D_GrSLType
};
+/**
+ * Types used to describe format of vertices in arrays
+ */
+enum GrVertexAttribType {
+ kFloat_GrVertexAttribType = 0,
+ kVec2f_GrVertexAttribType,
+ kVec3f_GrVertexAttribType,
+ kVec4f_GrVertexAttribType,
+ kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors
+
+ kLast_GrVertexAttribType = kVec4ub_GrVertexAttribType
+};
+static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
+
+struct GrVertexAttrib {
+ inline void set(GrVertexAttribType type, size_t offset) {
+ fType = type; fOffset = offset;
+ }
+ bool operator==(const GrVertexAttrib& other) const {
+ return fType == other.fType && fOffset == other.fOffset;
+ };
+ bool operator!=(const GrVertexAttrib& other) const { return !(*this == other); }
+
+ GrVertexAttribType fType;
+ size_t fOffset;
+};
+
+template <int N>
+class GrVertexAttribArray : public SkSTArray<N, GrVertexAttrib, true> {};
+
#endif
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrDrawState.h » ('j') | src/gpu/gl/GrGLProgramDesc.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698