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

Side by Side Diff: src/gpu/instanced/InstanceProcessor.cpp

Issue 2248323003: Simplify adding attributes to GrGeometryProcessor (Closed) Base URL: https://chromium.googlesource.com/skia.git@xformhelper
Patch Set: Revert removal of fAttribNames Created 4 years, 4 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/GrDistanceFieldGeoProc.cpp ('k') | tests/PrimitiveProcessorTest.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 2016 Google Inc. 2 * Copyright 2016 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 #include "InstanceProcessor.h" 8 #include "InstanceProcessor.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 26 matching lines...) Expand all
37 !glslCaps.sampleMaskOverrideCoverageSupport()) { 37 !glslCaps.sampleMaskOverrideCoverageSupport()) {
38 return GrCaps::InstancedSupport::kMultisampled; 38 return GrCaps::InstancedSupport::kMultisampled;
39 } 39 }
40 return GrCaps::InstancedSupport::kMixedSampled; 40 return GrCaps::InstancedSupport::kMixedSampled;
41 } 41 }
42 42
43 InstanceProcessor::InstanceProcessor(BatchInfo batchInfo, GrBuffer* paramsBuffer ) 43 InstanceProcessor::InstanceProcessor(BatchInfo batchInfo, GrBuffer* paramsBuffer )
44 : fBatchInfo(batchInfo) { 44 : fBatchInfo(batchInfo) {
45 this->initClassID<InstanceProcessor>(); 45 this->initClassID<InstanceProcessor>();
46 46
47 this->addVertexAttrib(Attribute("shapeCoords", kVec2f_GrVertexAttribType, kH igh_GrSLPrecision)); 47 this->addVertexAttrib("shapeCoords", kVec2f_GrVertexAttribType, kHigh_GrSLPr ecision);
48 this->addVertexAttrib(Attribute("vertexAttrs", kInt_GrVertexAttribType)); 48 this->addVertexAttrib("vertexAttrs", kInt_GrVertexAttribType);
49 this->addVertexAttrib(Attribute("instanceInfo", kUint_GrVertexAttribType)); 49 this->addVertexAttrib("instanceInfo", kUint_GrVertexAttribType);
50 this->addVertexAttrib(Attribute("shapeMatrixX", kVec3f_GrVertexAttribType, 50 this->addVertexAttrib("shapeMatrixX", kVec3f_GrVertexAttribType, kHigh_GrSLP recision);
51 kHigh_GrSLPrecision)); 51 this->addVertexAttrib("shapeMatrixY", kVec3f_GrVertexAttribType, kHigh_GrSLP recision);
52 this->addVertexAttrib(Attribute("shapeMatrixY", kVec3f_GrVertexAttribType, 52 this->addVertexAttrib("color", kVec4f_GrVertexAttribType, kLow_GrSLPrecision );
53 kHigh_GrSLPrecision)); 53 this->addVertexAttrib("localRect", kVec4f_GrVertexAttribType, kHigh_GrSLPrec ision);
54 this->addVertexAttrib(Attribute("color", kVec4f_GrVertexAttribType, kLow_GrS LPrecision));
55 this->addVertexAttrib(Attribute("localRect", kVec4f_GrVertexAttribType, kHig h_GrSLPrecision));
56 54
57 GR_STATIC_ASSERT(0 == (int)Attrib::kShapeCoords); 55 GR_STATIC_ASSERT(0 == (int)Attrib::kShapeCoords);
58 GR_STATIC_ASSERT(1 == (int)Attrib::kVertexAttrs); 56 GR_STATIC_ASSERT(1 == (int)Attrib::kVertexAttrs);
59 GR_STATIC_ASSERT(2 == (int)Attrib::kInstanceInfo); 57 GR_STATIC_ASSERT(2 == (int)Attrib::kInstanceInfo);
60 GR_STATIC_ASSERT(3 == (int)Attrib::kShapeMatrixX); 58 GR_STATIC_ASSERT(3 == (int)Attrib::kShapeMatrixX);
61 GR_STATIC_ASSERT(4 == (int)Attrib::kShapeMatrixY); 59 GR_STATIC_ASSERT(4 == (int)Attrib::kShapeMatrixY);
62 GR_STATIC_ASSERT(5 == (int)Attrib::kColor); 60 GR_STATIC_ASSERT(5 == (int)Attrib::kColor);
63 GR_STATIC_ASSERT(6 == (int)Attrib::kLocalRect); 61 GR_STATIC_ASSERT(6 == (int)Attrib::kLocalRect);
64 GR_STATIC_ASSERT(7 == kNumAttribs); 62 GR_STATIC_ASSERT(7 == kNumAttribs);
65 63
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 2111
2114 case kCorneredRect_FirstIndex: return "basic_round_rect"; 2112 case kCorneredRect_FirstIndex: return "basic_round_rect";
2115 case kCorneredFramedRect_FirstIndex: return "coverage_round_rect"; 2113 case kCorneredFramedRect_FirstIndex: return "coverage_round_rect";
2116 case kCorneredRectFanned_FirstIndex: return "mixed_samples_round_rect"; 2114 case kCorneredRectFanned_FirstIndex: return "mixed_samples_round_rect";
2117 2115
2118 default: return "unknown"; 2116 default: return "unknown";
2119 } 2117 }
2120 } 2118 }
2121 2119
2122 } 2120 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | tests/PrimitiveProcessorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698