OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 viewM.mapRect(&devBounds); | 541 viewM.mapRect(&devBounds); |
542 | 542 |
543 GrDeviceCoordTexture dstCopy; | 543 GrDeviceCoordTexture dstCopy; |
544 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { | 544 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { |
545 return; | 545 return; |
546 } | 546 } |
547 | 547 |
548 this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL); | 548 this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL); |
549 } | 549 } |
550 | 550 |
551 void GrDrawTarget::drawPaths(int pathCount, const GrPath** paths, | 551 void GrDrawTarget::drawPaths(const GrPathRange* pathRange, |
552 const SkMatrix* transforms, | 552 const uint32_t indices[], int count, |
553 SkPath::FillType fill, SkStrokeRec::Style stroke) { | 553 const float transforms[], GrTransformFormat transfo rmsFormat, |
554 SkASSERT(pathCount > 0); | 554 SkPath::FillType fill) { |
555 SkASSERT(NULL != paths); | |
556 SkASSERT(NULL != paths[0]); | |
557 SkASSERT(this->caps()->pathRenderingSupport()); | 555 SkASSERT(this->caps()->pathRenderingSupport()); |
558 SkASSERT(!SkPath::IsInverseFillType(fill)); | 556 SkASSERT(NULL != pathRange); |
557 SkASSERT(NULL != transforms); | |
559 | 558 |
560 const GrDrawState* drawState = &getDrawState(); | 559 // Don't compute a bounding box for setupDstReadIfNecessary(), we'll opt |
561 | 560 // instead for it to just copy the entire dst. Realistically this is a moot |
562 SkRect devBounds; | 561 // point, because any context that supports NV_path_rendering will also |
563 transforms[0].mapRect(&devBounds, paths[0]->getBounds()); | 562 // support NV_blend_equation_advanced. |
bsalomon
2014/07/17 17:27:28
Where's that CL? :)
Chris Dalton
2014/07/17 18:15:19
That's what I keep wondering :-\
| |
564 for (int i = 1; i < pathCount; ++i) { | |
565 SkRect mappedPathBounds; | |
566 transforms[i].mapRect(&mappedPathBounds, paths[i]->getBounds()); | |
567 devBounds.join(mappedPathBounds); | |
568 } | |
569 | |
570 SkMatrix viewM = drawState->getViewMatrix(); | |
571 viewM.mapRect(&devBounds); | |
572 | |
573 GrDeviceCoordTexture dstCopy; | 563 GrDeviceCoordTexture dstCopy; |
574 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { | 564 if (!this->setupDstReadIfNecessary(&dstCopy, NULL)) { |
575 return; | 565 return; |
576 } | 566 } |
577 | 567 |
578 this->onDrawPaths(pathCount, paths, transforms, fill, stroke, | 568 this->onDrawPaths(pathRange, indices, count, transforms, transformsFormat, f ill, |
579 dstCopy.texture() ? &dstCopy : NULL); | 569 dstCopy.texture() ? &dstCopy : NULL); |
580 } | 570 } |
581 | 571 |
582 typedef GrTraceMarkerSet::Iter TMIter; | 572 typedef GrTraceMarkerSet::Iter TMIter; |
583 void GrDrawTarget::saveActiveTraceMarkers() { | 573 void GrDrawTarget::saveActiveTraceMarkers() { |
584 if (this->caps()->gpuTracingSupport()) { | 574 if (this->caps()->gpuTracingSupport()) { |
585 SkASSERT(0 == fStoredTraceMarkers.count()); | 575 SkASSERT(0 == fStoredTraceMarkers.count()); |
586 fStoredTraceMarkers.addSet(fActiveTraceMarkers); | 576 fStoredTraceMarkers.addSet(fActiveTraceMarkers); |
587 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMark ers.end(); ++iter) { | 577 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMark ers.end(); ++iter) { |
588 this->removeGpuTraceMarker(&(*iter)); | 578 this->removeGpuTraceMarker(&(*iter)); |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1161 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 1151 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
1162 | 1152 |
1163 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1153 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1164 r.appendf("%s is uploadable to a texture: %s\n", | 1154 r.appendf("%s is uploadable to a texture: %s\n", |
1165 kConfigNames[i], | 1155 kConfigNames[i], |
1166 gNY[fConfigTextureSupport[i]]); | 1156 gNY[fConfigTextureSupport[i]]); |
1167 } | 1157 } |
1168 | 1158 |
1169 return r; | 1159 return r; |
1170 } | 1160 } |
OLD | NEW |