| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 SkLinearBitmapPipeline_tile_DEFINED | 8 #ifndef SkLinearBitmapPipeline_tile_DEFINED |
| 9 #define SkLinearBitmapPipeline_tile_DEFINED | 9 #define SkLinearBitmapPipeline_tile_DEFINED |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 Span center = span.breakAt(fXMax, dx); | 84 Span center = span.breakAt(fXMax, dx); |
| 85 if (!center.isEmpty()) { | 85 if (!center.isEmpty()) { |
| 86 next->pointSpan(center); | 86 next->pointSpan(center); |
| 87 } | 87 } |
| 88 if (!span.isEmpty()) { | 88 if (!span.isEmpty()) { |
| 89 span.clampToSinglePixel({fXMax - 1, y}); | 89 span.clampToSinglePixel({fXMax - 1, y}); |
| 90 next->pointSpan(span); | 90 next->pointSpan(span); |
| 91 } | 91 } |
| 92 } else { | 92 } else { |
| 93 Span center = span.breakAt(fXMax, dx); | 93 Span rightClamped = span.breakAt(fXMax, dx); |
| 94 | 94 if (!rightClamped.isEmpty()) { |
| 95 if (!span.isEmpty()) { | 95 rightClamped.clampToSinglePixel({fXMax - 1, y}); |
| 96 span.clampToSinglePixel({fXMax - 1, y}); | 96 next->pointSpan(rightClamped); |
| 97 next->pointSpan(span); | |
| 98 } | 97 } |
| 99 Span leftEdge = center.breakAt(0.0f, dx); | 98 Span center = span.breakAt(0.0f, dx); |
| 100 if (!center.isEmpty()) { | 99 if (!center.isEmpty()) { |
| 101 next->pointSpan(center); | 100 next->pointSpan(center); |
| 102 } | 101 } |
| 103 if (!leftEdge.isEmpty()) { | 102 if (!span.isEmpty()) { |
| 104 leftEdge.clampToSinglePixel({0.0f, y}); | 103 span.clampToSinglePixel({0.0f, y}); |
| 105 next->pointSpan(leftEdge); | 104 next->pointSpan(span); |
| 106 } | 105 } |
| 107 } | 106 } |
| 108 return true; | 107 return true; |
| 109 } | 108 } |
| 110 | 109 |
| 111 private: | 110 private: |
| 112 const Sk4s fXsMax; | 111 const Sk4s fXsMax; |
| 113 const SkScalar fXMax; | 112 const SkScalar fXMax; |
| 114 }; | 113 }; |
| 115 | 114 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 414 |
| 416 private: | 415 private: |
| 417 SkScalar fYMax; | 416 SkScalar fYMax; |
| 418 Sk4f fYsMax; | 417 Sk4f fYsMax; |
| 419 Sk4f fYsCap; | 418 Sk4f fYsCap; |
| 420 Sk4f fYsDoubleInvMax; | 419 Sk4f fYsDoubleInvMax; |
| 421 }; | 420 }; |
| 422 | 421 |
| 423 } // namespace | 422 } // namespace |
| 424 #endif // SkLinearBitmapPipeline_tile_DEFINED | 423 #endif // SkLinearBitmapPipeline_tile_DEFINED |
| OLD | NEW |