| 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 "GrDrawPathBatch.h" | 8 #include "GrDrawPathBatch.h" |
| 9 | 9 |
| 10 static void pre_translate_transform_values(const float* xforms, | 10 static void pre_translate_transform_values(const float* xforms, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 SkASSERT(!that->overrides().willColorBlendWithDst()); | 96 SkASSERT(!that->overrides().willColorBlendWithDst()); |
| 97 fTotalPathCount += that->fTotalPathCount; | 97 fTotalPathCount += that->fTotalPathCount; |
| 98 while (Draw* head = that->fDraws.head()) { | 98 while (Draw* head = that->fDraws.head()) { |
| 99 Draw* draw = fDraws.addToTail(); | 99 Draw* draw = fDraws.addToTail(); |
| 100 draw->fInstanceData.reset(head->fInstanceData.release()); | 100 draw->fInstanceData.reset(head->fInstanceData.release()); |
| 101 draw->fX = head->fX; | 101 draw->fX = head->fX; |
| 102 draw->fY = head->fY; | 102 draw->fY = head->fY; |
| 103 that->fDraws.popHead(); | 103 that->fDraws.popHead(); |
| 104 } | 104 } |
| 105 this->joinBounds(that->fBounds); |
| 105 return true; | 106 return true; |
| 106 } | 107 } |
| 107 | 108 |
| 108 void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) { | 109 void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) { |
| 109 const Draw& head = *fDraws.head(); | 110 const Draw& head = *fDraws.head(); |
| 110 | 111 |
| 111 SkMatrix drawMatrix(this->viewMatrix()); | 112 SkMatrix drawMatrix(this->viewMatrix()); |
| 112 drawMatrix.preScale(fScale, fScale); | 113 drawMatrix.preScale(fScale, fScale); |
| 113 drawMatrix.preTranslate(head.fX, head.fY); | 114 drawMatrix.preTranslate(head.fX, head.fY); |
| 114 | 115 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 dst[i + 3] = xforms[i + 3]; | 202 dst[i + 3] = xforms[i + 3]; |
| 202 dst[i + 4] = xforms[i + 4]; | 203 dst[i + 4] = xforms[i + 4]; |
| 203 dst[i + 5] = xforms[i + 3] * x + xforms[i + 4] * y + xforms[i +
5]; | 204 dst[i + 5] = xforms[i + 3] * x + xforms[i + 4] * y + xforms[i +
5]; |
| 204 } | 205 } |
| 205 break; | 206 break; |
| 206 default: | 207 default: |
| 207 SkFAIL("Unknown transform type."); | 208 SkFAIL("Unknown transform type."); |
| 208 break; | 209 break; |
| 209 } | 210 } |
| 210 } | 211 } |
| OLD | NEW |