| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrRectBatch.h" | 8 #include "GrRectBatch.h" |
| 9 | 9 |
| 10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 static const int kColorOffset = sizeof(SkPoint); | 151 static const int kColorOffset = sizeof(SkPoint); |
| 152 GrColor* vertColor = GrTCast<GrColor*>(offset + kColorOffset); | 152 GrColor* vertColor = GrTCast<GrColor*>(offset + kColorOffset); |
| 153 for (int j = 0; j < 4; ++j) { | 153 for (int j = 0; j < 4; ++j) { |
| 154 *vertColor = geom.fColor; | 154 *vertColor = geom.fColor; |
| 155 vertColor = (GrColor*) ((intptr_t) vertColor + vertexStride); | 155 vertColor = (GrColor*) ((intptr_t) vertColor + vertexStride); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 helper.issueDraws(batchTarget); | 159 helper.issueDraw(batchTarget); |
| 160 } | 160 } |
| 161 | 161 |
| 162 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 162 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 RectBatch(const Geometry& geometry) { | 165 RectBatch(const Geometry& geometry) { |
| 166 this->initClassID<RectBatch>(); | 166 this->initClassID<RectBatch>(); |
| 167 fGeoData.push_back(geometry); | 167 fGeoData.push_back(geometry); |
| 168 | 168 |
| 169 fBounds = geometry.fRect; | 169 fBounds = geometry.fRect; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 geometry.fHasLocalMatrix = true; | 242 geometry.fHasLocalMatrix = true; |
| 243 geometry.fLocalMatrix = *localMatrix; | 243 geometry.fLocalMatrix = *localMatrix; |
| 244 } else { | 244 } else { |
| 245 geometry.fHasLocalMatrix = false; | 245 geometry.fHasLocalMatrix = false; |
| 246 } | 246 } |
| 247 | 247 |
| 248 return RectBatch::Create(geometry); | 248 return RectBatch::Create(geometry); |
| 249 } | 249 } |
| 250 | 250 |
| 251 }; | 251 }; |
| OLD | NEW |