| 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 "GrDrawContext.h" | 8 #include "GrDrawContext.h" |
| 9 #include "GrDrawingManager.h" | 9 #include "GrDrawingManager.h" |
| 10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 fDrawTargets[i]->prepareBatches(&fFlushState); | 77 fDrawTargets[i]->prepareBatches(&fFlushState); |
| 78 } | 78 } |
| 79 | 79 |
| 80 // Upload all data to the GPU | 80 // Upload all data to the GPU |
| 81 fFlushState.preIssueDraws(); | 81 fFlushState.preIssueDraws(); |
| 82 | 82 |
| 83 for (int i = 0; i < fDrawTargets.count(); ++i) { | 83 for (int i = 0; i < fDrawTargets.count(); ++i) { |
| 84 fDrawTargets[i]->drawBatches(&fFlushState); | 84 fDrawTargets[i]->drawBatches(&fFlushState); |
| 85 } | 85 } |
| 86 | 86 |
| 87 SkASSERT(fFlushState.lastFlushedToken() == fFlushState.currentToken()); | 87 SkASSERT(fFlushState.nextDrawToken() == fFlushState.nextTokenToFlush()); |
| 88 | 88 |
| 89 for (int i = 0; i < fDrawTargets.count(); ++i) { | 89 for (int i = 0; i < fDrawTargets.count(); ++i) { |
| 90 fDrawTargets[i]->reset(); | 90 fDrawTargets[i]->reset(); |
| 91 #ifdef ENABLE_MDB | 91 #ifdef ENABLE_MDB |
| 92 fDrawTargets[i]->unref(); | 92 fDrawTargets[i]->unref(); |
| 93 #endif | 93 #endif |
| 94 } | 94 } |
| 95 | 95 |
| 96 #ifndef ENABLE_MDB | 96 #ifndef ENABLE_MDB |
| 97 // When MDB is disabled we keep reusing the same drawTarget | 97 // When MDB is disabled we keep reusing the same drawTarget |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt); | 176 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt); |
| 177 if (sb) { | 177 if (sb) { |
| 178 return new GrPathRenderingDrawContext(fContext, this, rt, surfacePro
ps, | 178 return new GrPathRenderingDrawContext(fContext, this, rt, surfacePro
ps, |
| 179 fContext->getAuditTrail(), fSi
ngleOwner); | 179 fContext->getAuditTrail(), fSi
ngleOwner); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi
tTrail(), | 183 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi
tTrail(), |
| 184 fSingleOwner); | 184 fSingleOwner); |
| 185 } | 185 } |
| OLD | NEW |