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[], PathTransformType transfo
rmsType, |
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 != indices); |
| 558 SkASSERT(NULL != transforms); |
559 | 559 |
560 const GrDrawState* drawState = &getDrawState(); | 560 // Don't compute a bounding box for setupDstReadIfNecessary(), we'll opt |
561 | 561 // instead for it to just copy the entire dst. Realistically this is a moot |
562 SkRect devBounds; | 562 // point, because any context that supports NV_path_rendering will also |
563 transforms[0].mapRect(&devBounds, paths[0]->getBounds()); | 563 // support NV_blend_equation_advanced. |
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; | 564 GrDeviceCoordTexture dstCopy; |
574 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { | 565 if (!this->setupDstReadIfNecessary(&dstCopy, NULL)) { |
575 return; | 566 return; |
576 } | 567 } |
577 | 568 |
578 this->onDrawPaths(pathCount, paths, transforms, fill, stroke, | 569 this->onDrawPaths(pathRange, indices, count, transforms, transformsType, fil
l, |
579 dstCopy.texture() ? &dstCopy : NULL); | 570 dstCopy.texture() ? &dstCopy : NULL); |
580 } | 571 } |
581 | 572 |
582 typedef GrTraceMarkerSet::Iter TMIter; | 573 typedef GrTraceMarkerSet::Iter TMIter; |
583 void GrDrawTarget::saveActiveTraceMarkers() { | 574 void GrDrawTarget::saveActiveTraceMarkers() { |
584 if (this->caps()->gpuTracingSupport()) { | 575 if (this->caps()->gpuTracingSupport()) { |
585 SkASSERT(0 == fStoredTraceMarkers.count()); | 576 SkASSERT(0 == fStoredTraceMarkers.count()); |
586 fStoredTraceMarkers.addSet(fActiveTraceMarkers); | 577 fStoredTraceMarkers.addSet(fActiveTraceMarkers); |
587 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMark
ers.end(); ++iter) { | 578 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMark
ers.end(); ++iter) { |
588 this->removeGpuTraceMarker(&(*iter)); | 579 this->removeGpuTraceMarker(&(*iter)); |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 1156 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
1166 | 1157 |
1167 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1158 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1168 r.appendf("%s is uploadable to a texture: %s\n", | 1159 r.appendf("%s is uploadable to a texture: %s\n", |
1169 kConfigNames[i], | 1160 kConfigNames[i], |
1170 gNY[fConfigTextureSupport[i]]); | 1161 gNY[fConfigTextureSupport[i]]); |
1171 } | 1162 } |
1172 | 1163 |
1173 return r; | 1164 return r; |
1174 } | 1165 } |
OLD | NEW |