OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.h" |
9 | 9 |
10 #include "GrBufferAllocPool.h" | 10 #include "GrBufferAllocPool.h" |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 int currState = 0; | 584 int currState = 0; |
585 int currClip = 0; | 585 int currClip = 0; |
586 int currClear = 0; | 586 int currClear = 0; |
587 int currDraw = 0; | 587 int currDraw = 0; |
588 int currStencilPath = 0; | 588 int currStencilPath = 0; |
589 int currDrawPath = 0; | 589 int currDrawPath = 0; |
590 int currDrawPaths = 0; | 590 int currDrawPaths = 0; |
591 int currCopySurface = 0; | 591 int currCopySurface = 0; |
592 int currCmdMarker = 0; | 592 int currCmdMarker = 0; |
593 | 593 |
| 594 fDstGpu->saveActiveTraceMarkers(); |
594 for (int c = 0; c < numCmds; ++c) { | 595 for (int c = 0; c < numCmds; ++c) { |
595 GrGpuTraceMarker newMarker("", -1); | 596 GrGpuTraceMarker newMarker("", -1); |
596 if (cmd_has_trace_marker(fCmds[c])) { | 597 if (cmd_has_trace_marker(fCmds[c])) { |
597 SkString traceString = fGpuCmdMarkers[currCmdMarker].toString(); | 598 SkString traceString = fGpuCmdMarkers[currCmdMarker].toString(); |
598 newMarker.fMarker = traceString.c_str(); | 599 newMarker.fMarker = traceString.c_str(); |
599 fDstGpu->addGpuTraceMarker(&newMarker); | 600 fDstGpu->addGpuTraceMarker(&newMarker); |
600 ++currCmdMarker; | 601 ++currCmdMarker; |
601 } | 602 } |
602 switch (strip_trace_bit(fCmds[c])) { | 603 switch (strip_trace_bit(fCmds[c])) { |
603 case kDraw_Cmd: { | 604 case kDraw_Cmd: { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 fCopySurfaces[currCopySurface].fSrc.get(), | 660 fCopySurfaces[currCopySurface].fSrc.get(), |
660 fCopySurfaces[currCopySurface].fSrcRect, | 661 fCopySurfaces[currCopySurface].fSrcRect, |
661 fCopySurfaces[currCopySurface].fDstPoint); | 662 fCopySurfaces[currCopySurface].fDstPoint); |
662 ++currCopySurface; | 663 ++currCopySurface; |
663 break; | 664 break; |
664 } | 665 } |
665 if (cmd_has_trace_marker(fCmds[c])) { | 666 if (cmd_has_trace_marker(fCmds[c])) { |
666 fDstGpu->removeGpuTraceMarker(&newMarker); | 667 fDstGpu->removeGpuTraceMarker(&newMarker); |
667 } | 668 } |
668 } | 669 } |
| 670 fDstGpu->restoreActiveTraceMarkers(); |
669 // we should have consumed all the states, clips, etc. | 671 // we should have consumed all the states, clips, etc. |
670 SkASSERT(fStates.count() == currState); | 672 SkASSERT(fStates.count() == currState); |
671 SkASSERT(fClips.count() == currClip); | 673 SkASSERT(fClips.count() == currClip); |
672 SkASSERT(fClipOrigins.count() == currClip); | 674 SkASSERT(fClipOrigins.count() == currClip); |
673 SkASSERT(fClears.count() == currClear); | 675 SkASSERT(fClears.count() == currClear); |
674 SkASSERT(fDraws.count() == currDraw); | 676 SkASSERT(fDraws.count() == currDraw); |
675 SkASSERT(fCopySurfaces.count() == currCopySurface); | 677 SkASSERT(fCopySurfaces.count() == currCopySurface); |
676 SkASSERT(fGpuCmdMarkers.count() == currCmdMarker); | 678 SkASSERT(fGpuCmdMarkers.count() == currCmdMarker); |
677 | 679 |
678 fDstGpu->setDrawState(prevDrawState); | 680 fDstGpu->setDrawState(prevDrawState); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 this->addToCmdBuffer(kCopySurface_Cmd); | 983 this->addToCmdBuffer(kCopySurface_Cmd); |
982 return &fCopySurfaces.push_back(); | 984 return &fCopySurfaces.push_back(); |
983 } | 985 } |
984 | 986 |
985 | 987 |
986 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 988 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
987 INHERITED::clipWillBeSet(newClipData); | 989 INHERITED::clipWillBeSet(newClipData); |
988 fClipSet = true; | 990 fClipSet = true; |
989 fClipProxyState = kUnknown_ClipProxyState; | 991 fClipProxyState = kUnknown_ClipProxyState; |
990 } | 992 } |
OLD | NEW |