Chromium Code Reviews| 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 #ifndef GrPendingProcessorStage_DEFINED | 8 #ifndef GrPendingProcessorStage_DEFINED |
| 9 #define GrPendingProcessorStage_DEFINED | 9 #define GrPendingProcessorStage_DEFINED |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 const SkMatrix& getCoordChangeMatrix() const { return fCoordChangeMatrix; } | 42 const SkMatrix& getCoordChangeMatrix() const { return fCoordChangeMatrix; } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * For a coord transform on the fragment processor, does it or the coord cha nge matrix (if | 45 * For a coord transform on the fragment processor, does it or the coord cha nge matrix (if |
| 46 * relevant) contain perspective? | 46 * relevant) contain perspective? |
| 47 */ | 47 */ |
| 48 bool isPerspectiveCoordTransform(int matrixIndex) const { | 48 bool isPerspectiveCoordTransform(int matrixIndex) const { |
| 49 const GrCoordTransform& coordTransform = this->getProcessor()->coordTran sform(matrixIndex); | 49 const GrCoordTransform& coordTransform = this->getProcessor()->coordTran sform(matrixIndex); |
| 50 uint32_t type = coordTransform.getMatrix().getType(); | 50 uint32_t type = coordTransform.getMatrix().getType(); |
| 51 if (kLocal_GrCoordSet == coordTransform.sourceCoords()) { | 51 if (kLocal_GrCoordSet == coordTransform.sourceCoords() || |
| 52 kDevice_GrCoordSet == coordTransform.sourceCoords()) { | |
|
bsalomon
2014/12/17 19:45:28
This is backwards... don't want to look at ccm if
| |
| 52 type |= this->getCoordChangeMatrix().getType(); | 53 type |= this->getCoordChangeMatrix().getType(); |
| 53 } | 54 } |
| 54 | 55 |
| 55 return SkToBool(SkMatrix::kPerspective_Mask & type); | 56 return SkToBool(SkMatrix::kPerspective_Mask & type); |
| 56 } | 57 } |
| 57 | 58 |
| 58 const char* name() const { return fProc->name(); } | 59 const char* name() const { return fProc->name(); } |
| 59 | 60 |
| 60 const GrFragmentProcessor* getProcessor() const { return fProc.get(); } | 61 const GrFragmentProcessor* getProcessor() const { return fProc.get(); } |
| 61 | 62 |
| 62 protected: | 63 protected: |
| 63 GrPendingProgramElement<const GrFragmentProcessor> fProc; | 64 GrPendingProgramElement<const GrFragmentProcessor> fProc; |
| 64 SkMatrix fCoordChangeMatrix; | 65 SkMatrix fCoordChangeMatrix; |
| 65 }; | 66 }; |
| 66 #endif | 67 #endif |
| OLD | NEW |