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

Side by Side Diff: src/gpu/gl/GrGLVertexArray.h

Issue 917373002: Use uint16s for texture coordinates when rendering text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use float uvs for distance field paths Created 5 years, 10 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/gpu/effects/GrDistanceFieldTextureEffect.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 GrGLVertexArray_DEFINED 8 #ifndef GrGLVertexArray_DEFINED
9 #define GrGLVertexArray_DEFINED 9 #define GrGLVertexArray_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 static inline const GrGLAttribLayout& GrGLAttribTypeToLayout(GrVertexAttribType type) { 28 static inline const GrGLAttribLayout& GrGLAttribTypeToLayout(GrVertexAttribType type) {
29 SkASSERT(type >= 0 && type < kGrVertexAttribTypeCount); 29 SkASSERT(type >= 0 && type < kGrVertexAttribTypeCount);
30 static const GrGLAttribLayout kLayouts[kGrVertexAttribTypeCount] = { 30 static const GrGLAttribLayout kLayouts[kGrVertexAttribTypeCount] = {
31 {1, GR_GL_FLOAT, false}, // kFloat_GrVertexAttribType 31 {1, GR_GL_FLOAT, false}, // kFloat_GrVertexAttribType
32 {2, GR_GL_FLOAT, false}, // kVec2f_GrVertexAttribType 32 {2, GR_GL_FLOAT, false}, // kVec2f_GrVertexAttribType
33 {3, GR_GL_FLOAT, false}, // kVec3f_GrVertexAttribType 33 {3, GR_GL_FLOAT, false}, // kVec3f_GrVertexAttribType
34 {4, GR_GL_FLOAT, false}, // kVec4f_GrVertexAttribType 34 {4, GR_GL_FLOAT, false}, // kVec4f_GrVertexAttribType
35 {1, GR_GL_UNSIGNED_BYTE, true}, // kUByte_GrVertexAttribType 35 {1, GR_GL_UNSIGNED_BYTE, true}, // kUByte_GrVertexAttribType
36 {4, GR_GL_UNSIGNED_BYTE, true}, // kVec4ub_GrVertexAttribType 36 {4, GR_GL_UNSIGNED_BYTE, true}, // kVec4ub_GrVertexAttribType
37 {2, GR_GL_SHORT, false}, // kVec2s_GrVertexAttribType
37 }; 38 };
38 GR_STATIC_ASSERT(0 == kFloat_GrVertexAttribType); 39 GR_STATIC_ASSERT(0 == kFloat_GrVertexAttribType);
39 GR_STATIC_ASSERT(1 == kVec2f_GrVertexAttribType); 40 GR_STATIC_ASSERT(1 == kVec2f_GrVertexAttribType);
40 GR_STATIC_ASSERT(2 == kVec3f_GrVertexAttribType); 41 GR_STATIC_ASSERT(2 == kVec3f_GrVertexAttribType);
41 GR_STATIC_ASSERT(3 == kVec4f_GrVertexAttribType); 42 GR_STATIC_ASSERT(3 == kVec4f_GrVertexAttribType);
42 GR_STATIC_ASSERT(4 == kUByte_GrVertexAttribType); 43 GR_STATIC_ASSERT(4 == kUByte_GrVertexAttribType);
43 GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType); 44 GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType);
45 GR_STATIC_ASSERT(6 == kVec2s_GrVertexAttribType);
44 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kLayouts) == kGrVertexAttribTypeCount); 46 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kLayouts) == kGrVertexAttribTypeCount);
45 return kLayouts[type]; 47 return kLayouts[type];
46 } 48 }
47 49
48 /** 50 /**
49 * This sets and tracks the vertex attribute array state. It is used internally by GrGLVertexArray 51 * This sets and tracks the vertex attribute array state. It is used internally by GrGLVertexArray
50 * (below) but is separate because it is also used to track the state of vertex array object 0. 52 * (below) but is separate because it is also used to track the state of vertex array object 0.
51 */ 53 */
52 class GrGLAttribArrayState { 54 class GrGLAttribArrayState {
53 public: 55 public:
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 private: 171 private:
170 GrGLuint fID; 172 GrGLuint fID;
171 GrGLAttribArrayState fAttribArrays; 173 GrGLAttribArrayState fAttribArrays;
172 GrGLuint fIndexBufferID; 174 GrGLuint fIndexBufferID;
173 bool fIndexBufferIDIsValid; 175 bool fIndexBufferIDIsValid;
174 176
175 typedef GrGpuResource INHERITED; 177 typedef GrGpuResource INHERITED;
176 }; 178 };
177 179
178 #endif 180 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldTextureEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698