OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |