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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 GrDeviceCoordTexture dstCopy; | 572 GrDeviceCoordTexture dstCopy; |
573 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { | 573 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { |
574 return; | 574 return; |
575 } | 575 } |
576 | 576 |
577 this->onDrawPaths(pathCount, paths, transforms, fill, stroke, | 577 this->onDrawPaths(pathCount, paths, transforms, fill, stroke, |
578 dstCopy.texture() ? &dstCopy : NULL); | 578 dstCopy.texture() ? &dstCopy : NULL); |
579 } | 579 } |
580 | 580 |
581 void GrDrawTarget::addGpuTraceMarker(GrGpuTraceMarker* marker) { | 581 typedef GrTraceMarkerSet::Iter TMIter; |
| 582 void GrDrawTarget::saveActiveTraceMarkers() { |
| 583 if (this->caps()->gpuTracingSupport()) { |
| 584 SkASSERT(0 == fStoredTraceMarkers.count()); |
| 585 fStoredTraceMarkers.addSet(fActiveTraceMarkers); |
| 586 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMark
ers.end(); ++iter) { |
| 587 this->removeGpuTraceMarker(&(*iter)); |
| 588 } |
| 589 } |
| 590 } |
| 591 |
| 592 void GrDrawTarget::restoreActiveTraceMarkers() { |
| 593 if (this->caps()->gpuTracingSupport()) { |
| 594 SkASSERT(0 == fActiveTraceMarkers.count()); |
| 595 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMark
ers.end(); ++iter) { |
| 596 this->addGpuTraceMarker(&(*iter)); |
| 597 } |
| 598 for (TMIter iter = fActiveTraceMarkers.begin(); iter != fActiveTraceMark
ers.end(); ++iter) { |
| 599 this->fStoredTraceMarkers.remove(*iter); |
| 600 } |
| 601 } |
| 602 } |
| 603 |
| 604 void GrDrawTarget::addGpuTraceMarker(const GrGpuTraceMarker* marker) { |
582 if (this->caps()->gpuTracingSupport()) { | 605 if (this->caps()->gpuTracingSupport()) { |
583 SkASSERT(fGpuTraceMarkerCount >= 0); | 606 SkASSERT(fGpuTraceMarkerCount >= 0); |
584 this->fActiveTraceMarkers.add(*marker); | 607 this->fActiveTraceMarkers.add(*marker); |
585 this->didAddGpuTraceMarker(); | 608 this->didAddGpuTraceMarker(); |
586 ++fGpuTraceMarkerCount; | 609 ++fGpuTraceMarkerCount; |
587 } | 610 } |
588 } | 611 } |
589 | 612 |
590 void GrDrawTarget::removeGpuTraceMarker(GrGpuTraceMarker* marker) { | 613 void GrDrawTarget::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
591 if (this->caps()->gpuTracingSupport()) { | 614 if (this->caps()->gpuTracingSupport()) { |
592 SkASSERT(fGpuTraceMarkerCount >= 1); | 615 SkASSERT(fGpuTraceMarkerCount >= 1); |
593 this->fActiveTraceMarkers.remove(*marker); | 616 this->fActiveTraceMarkers.remove(*marker); |
594 this->didRemoveGpuTraceMarker(); | 617 this->didRemoveGpuTraceMarker(); |
595 --fGpuTraceMarkerCount; | 618 --fGpuTraceMarkerCount; |
596 } | 619 } |
597 } | 620 } |
598 | 621 |
599 //////////////////////////////////////////////////////////////////////////////// | 622 //////////////////////////////////////////////////////////////////////////////// |
600 | 623 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 1158 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
1136 | 1159 |
1137 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1160 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1138 r.appendf("%s is uploadable to a texture: %s\n", | 1161 r.appendf("%s is uploadable to a texture: %s\n", |
1139 kConfigNames[i], | 1162 kConfigNames[i], |
1140 gNY[fConfigTextureSupport[i]]); | 1163 gNY[fConfigTextureSupport[i]]); |
1141 } | 1164 } |
1142 | 1165 |
1143 return r; | 1166 return r; |
1144 } | 1167 } |
OLD | NEW |