| 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 #ifndef GrPipeline_DEFINED | 8 #ifndef GrPipeline_DEFINED |
| 9 #define GrPipeline_DEFINED | 9 #define GrPipeline_DEFINED |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 /////////////////////////////////////////////////////////////////////////// | 73 /////////////////////////////////////////////////////////////////////////// |
| 74 /// @name Comparisons | 74 /// @name Comparisons |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * Returns true if these pipelines are equivalent. Coord transforms may be
applied either on | 77 * Returns true if these pipelines are equivalent. Coord transforms may be
applied either on |
| 78 * the GPU or the CPU. When we apply them on the CPU then the matrices need
not agree in order | 78 * the GPU or the CPU. When we apply them on the CPU then the matrices need
not agree in order |
| 79 * to combine draws. Therefore we take a param that indicates whether coord
transforms should be | 79 * to combine draws. Therefore we take a param that indicates whether coord
transforms should be |
| 80 * compared." | 80 * compared." |
| 81 */ | 81 */ |
| 82 static bool AreEqual(const GrPipeline& a, const GrPipeline& b, bool ignoreCo
ordTransforms); | 82 static bool AreEqual(const GrPipeline& a, const GrPipeline& b); |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * Allows a GrBatch subclass to determine whether two GrBatches can combine.
This is a stricter | 85 * Allows a GrBatch subclass to determine whether two GrBatches can combine.
This is a stricter |
| 86 * test than isEqual because it also considers blend barriers when the two b
atches' bounds | 86 * test than isEqual because it also considers blend barriers when the two b
atches' bounds |
| 87 * overlap | 87 * overlap |
| 88 */ | 88 */ |
| 89 static bool CanCombine(const GrPipeline& a, const SkRect& aBounds, | 89 static bool CanCombine(const GrPipeline& a, const SkRect& aBounds, |
| 90 const GrPipeline& b, const SkRect& bBounds, | 90 const GrPipeline& b, const SkRect& bBounds, |
| 91 const GrCaps& caps, | 91 const GrCaps& caps) { |
| 92 bool ignoreCoordTransforms = false) { | 92 if (!AreEqual(a, b)) { |
| 93 if (!AreEqual(a, b, ignoreCoordTransforms)) { | |
| 94 return false; | 93 return false; |
| 95 } | 94 } |
| 96 if (a.xferBarrierType(caps)) { | 95 if (a.xferBarrierType(caps)) { |
| 97 return aBounds.fRight <= bBounds.fLeft || | 96 return aBounds.fRight <= bBounds.fLeft || |
| 98 aBounds.fBottom <= bBounds.fTop || | 97 aBounds.fBottom <= bBounds.fTop || |
| 99 bBounds.fRight <= aBounds.fLeft || | 98 bBounds.fRight <= aBounds.fLeft || |
| 100 bBounds.fBottom <= aBounds.fTop; | 99 bBounds.fBottom <= aBounds.fTop; |
| 101 } | 100 } |
| 102 return true; | 101 return true; |
| 103 } | 102 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 FragmentProcessorArray fFragmentProcessors; | 230 FragmentProcessorArray fFragmentProcessors; |
| 232 bool fIgnoresCoverage; | 231 bool fIgnoresCoverage; |
| 233 | 232 |
| 234 // This value is also the index in fFragmentProcessors where coverage proces
sors begin. | 233 // This value is also the index in fFragmentProcessors where coverage proces
sors begin. |
| 235 int fNumColorProcessors; | 234 int fNumColorProcessors; |
| 236 | 235 |
| 237 typedef SkRefCnt INHERITED; | 236 typedef SkRefCnt INHERITED; |
| 238 }; | 237 }; |
| 239 | 238 |
| 240 #endif | 239 #endif |
| OLD | NEW |