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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // combined. (Glyphs in the same font tend to wind the same direction so it
works out OK.) | 92 // combined. (Glyphs in the same font tend to wind the same direction so it
works out OK.) |
93 if (GrPathRendering::kWinding_FillType != this->fillType() || | 93 if (GrPathRendering::kWinding_FillType != this->fillType() || |
94 this->stencilSettings() != that->stencilSettings() || | 94 this->stencilSettings() != that->stencilSettings() || |
95 this->overrides().willColorBlendWithDst()) { | 95 this->overrides().willColorBlendWithDst()) { |
96 return false; | 96 return false; |
97 } | 97 } |
98 SkASSERT(!that->overrides().willColorBlendWithDst()); | 98 SkASSERT(!that->overrides().willColorBlendWithDst()); |
99 fTotalPathCount += that->fTotalPathCount; | 99 fTotalPathCount += that->fTotalPathCount; |
100 while (Draw* head = that->fDraws.head()) { | 100 while (Draw* head = that->fDraws.head()) { |
101 Draw* draw = fDraws.addToTail(); | 101 Draw* draw = fDraws.addToTail(); |
102 draw->fInstanceData.reset(head->fInstanceData.detach()); | 102 draw->fInstanceData.reset(head->fInstanceData.release()); |
103 draw->fX = head->fX; | 103 draw->fX = head->fX; |
104 draw->fY = head->fY; | 104 draw->fY = head->fY; |
105 that->fDraws.popHead(); | 105 that->fDraws.popHead(); |
106 } | 106 } |
107 return true; | 107 return true; |
108 } | 108 } |
109 | 109 |
110 void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) { | 110 void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) { |
111 const Draw& head = *fDraws.head(); | 111 const Draw& head = *fDraws.head(); |
112 | 112 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 dst[i + 3] = xforms[i + 3]; | 198 dst[i + 3] = xforms[i + 3]; |
199 dst[i + 4] = xforms[i + 4]; | 199 dst[i + 4] = xforms[i + 4]; |
200 dst[i + 5] = xforms[i + 3] * x + xforms[i + 4] * y + xforms[i +
5]; | 200 dst[i + 5] = xforms[i + 3] * x + xforms[i + 4] * y + xforms[i +
5]; |
201 } | 201 } |
202 break; | 202 break; |
203 default: | 203 default: |
204 SkFAIL("Unknown transform type."); | 204 SkFAIL("Unknown transform type."); |
205 break; | 205 break; |
206 } | 206 } |
207 } | 207 } |
OLD | NEW |