| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrDefaultGeoProcFactory.h" | 8 #include "GrDefaultGeoProcFactory.h" |
| 9 | 9 |
| 10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 | 188 |
| 189 private: | 189 private: |
| 190 DefaultGeoProc(uint32_t gpTypeFlags, | 190 DefaultGeoProc(uint32_t gpTypeFlags, |
| 191 GrColor color, | 191 GrColor color, |
| 192 const SkMatrix& viewMatrix, | 192 const SkMatrix& viewMatrix, |
| 193 const SkMatrix& localMatrix, | 193 const SkMatrix& localMatrix, |
| 194 uint8_t coverage, | 194 uint8_t coverage, |
| 195 bool localCoordsWillBeRead, | 195 bool localCoordsWillBeRead, |
| 196 bool coverageWillBeIgnored) | 196 bool coverageWillBeIgnored) |
| 197 : fInPosition(NULL) | 197 : fInPosition(nullptr) |
| 198 , fInColor(NULL) | 198 , fInColor(nullptr) |
| 199 , fInLocalCoords(NULL) | 199 , fInLocalCoords(nullptr) |
| 200 , fInCoverage(NULL) | 200 , fInCoverage(nullptr) |
| 201 , fColor(color) | 201 , fColor(color) |
| 202 , fViewMatrix(viewMatrix) | 202 , fViewMatrix(viewMatrix) |
| 203 , fLocalMatrix(localMatrix) | 203 , fLocalMatrix(localMatrix) |
| 204 , fCoverage(coverage) | 204 , fCoverage(coverage) |
| 205 , fFlags(gpTypeFlags) | 205 , fFlags(gpTypeFlags) |
| 206 , fLocalCoordsWillBeRead(localCoordsWillBeRead) | 206 , fLocalCoordsWillBeRead(localCoordsWillBeRead) |
| 207 , fCoverageWillBeIgnored(coverageWillBeIgnored) { | 207 , fCoverageWillBeIgnored(coverageWillBeIgnored) { |
| 208 this->initClassID<DefaultGeoProc>(); | 208 this->initClassID<DefaultGeoProc>(); |
| 209 bool hasColor = SkToBool(gpTypeFlags & kColor_GPFlag); | 209 bool hasColor = SkToBool(gpTypeFlags & kColor_GPFlag); |
| 210 bool hasExplicitLocalCoords = SkToBool(gpTypeFlags & kLocalCoord_GPFlag)
; | 210 bool hasExplicitLocalCoords = SkToBool(gpTypeFlags & kLocalCoord_GPFlag)
; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 const GrGeometryProcessor* GrDefaultGeoProcFactory::CreateForDeviceSpace( | 303 const GrGeometryProcessor* GrDefaultGeoProcFactory::CreateForDeviceSpace( |
| 304 const Color
& color, | 304 const Color
& color, |
| 305 const Cover
age& coverage, | 305 const Cover
age& coverage, |
| 306 const Local
Coords& localCoords, | 306 const Local
Coords& localCoords, |
| 307 const SkMat
rix& viewMatrix) { | 307 const SkMat
rix& viewMatrix) { |
| 308 SkMatrix invert = SkMatrix::I(); | 308 SkMatrix invert = SkMatrix::I(); |
| 309 if (LocalCoords::kUnused_Type != localCoords.fType) { | 309 if (LocalCoords::kUnused_Type != localCoords.fType) { |
| 310 SkASSERT(LocalCoords::kUsePosition_Type == localCoords.fType); | 310 SkASSERT(LocalCoords::kUsePosition_Type == localCoords.fType); |
| 311 if (!viewMatrix.isIdentity() && !viewMatrix.invert(&invert)) { | 311 if (!viewMatrix.isIdentity() && !viewMatrix.invert(&invert)) { |
| 312 SkDebugf("Could not invert\n"); | 312 SkDebugf("Could not invert\n"); |
| 313 return NULL; | 313 return nullptr; |
| 314 } | 314 } |
| 315 | 315 |
| 316 if (localCoords.hasLocalMatrix()) { | 316 if (localCoords.hasLocalMatrix()) { |
| 317 invert.preConcat(*localCoords.fMatrix); | 317 invert.preConcat(*localCoords.fMatrix); |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 | 320 |
| 321 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); | 321 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); |
| 322 return Create(color, coverage, inverted, SkMatrix::I()); | 322 return Create(color, coverage, inverted, SkMatrix::I()); |
| 323 } | 323 } |
| OLD | NEW |