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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 */ | 176 */ |
177 const GrGeometryProcessor* createRectGP() { | 177 const GrGeometryProcessor* createRectGP() { |
178 using namespace GrDefaultGeoProcFactory; | 178 using namespace GrDefaultGeoProcFactory; |
179 Color color(Color::kAttribute_Type); | 179 Color color(Color::kAttribute_Type); |
180 Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type : Cover
age::kSolid_Type); | 180 Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type : Cover
age::kSolid_Type); |
181 | 181 |
182 // if we have a local rect, then we apply the localMatrix directly to th
e localRect to | 182 // if we have a local rect, then we apply the localMatrix directly to th
e localRect to |
183 // generate vertex local coords | 183 // generate vertex local coords |
184 if (this->hasLocalRect()) { | 184 if (this->hasLocalRect()) { |
185 LocalCoords localCoords(LocalCoords::kHasExplicit_Type); | 185 LocalCoords localCoords(LocalCoords::kHasExplicit_Type); |
186 return GrDefaultGeoProcFactory::Create(color, coverage, localCoords)
; | 186 return GrDefaultGeoProcFactory::Create(color, coverage, localCoords,
SkMatrix::I()); |
187 } else { | 187 } else { |
188 LocalCoords localCoords(LocalCoords::kUsePosition_Type, | 188 LocalCoords localCoords(LocalCoords::kUsePosition_Type, |
189 this->hasLocalMatrix() ? &this->localMatrix(
) : NULL); | 189 this->hasLocalMatrix() ? &this->localMatrix(
) : NULL); |
190 return GrDefaultGeoProcFactory::CreateForDeviceSpace(color, coverage
, localCoords, | 190 return GrDefaultGeoProcFactory::CreateForDeviceSpace(color, coverage
, localCoords, |
191 this->viewMatri
x()); | 191 this->viewMatri
x()); |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 | 195 |
196 struct BatchTracker { | 196 struct BatchTracker { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 if (hasLocalMatrix) { | 259 if (hasLocalMatrix) { |
260 localMatrix = GrTest::TestMatrix(random); | 260 localMatrix = GrTest::TestMatrix(random); |
261 } | 261 } |
262 | 262 |
263 return GrRectBatch::Create(color, viewMatrix, rect, | 263 return GrRectBatch::Create(color, viewMatrix, rect, |
264 hasLocalRect ? &localRect : NULL, | 264 hasLocalRect ? &localRect : NULL, |
265 hasLocalMatrix ? &localMatrix : NULL); | 265 hasLocalMatrix ? &localMatrix : NULL); |
266 } | 266 } |
267 | 267 |
268 #endif | 268 #endif |
OLD | NEW |