const Options& options)
: fGpu(SkRef(gpu))
, fResourceProvider(resourceProvider)
- , fFlushing(false)
, fFlags(0)
, fRenderTarget(rt) {
// TODO: Stop extracting the context (currently needed by GrClipMaskManager)
}
void GrDrawTarget::prepareBatches(GrBatchFlushState* flushState) {
- if (fFlushing) {
- return;
- }
- fFlushing = true;
-
// Semi-usually the drawTargets are already closed at this point, but sometimes Ganesh
// needs to flush mid-draw. In that case, the SkGpuDevice's drawTargets won't be closed
// but need to be flushed anyway. Closing such drawTargets here will mean new
}
fBatches[i]->draw(flushState);
}
-
- fFlushing = false;
}
void GrDrawTarget::reset() {
GrContext* fContext;
GrGpu* fGpu;
GrResourceProvider* fResourceProvider;
- bool fFlushing;
SkDEBUGCODE(int fDebugID;)
uint32_t fFlags;
}
void GrDrawingManager::flush() {
+ if (fFlushing) {
+ return;
+ }
+ fFlushing = true;
+
SkDEBUGCODE(bool result =)
SkTTopoSort<GrDrawTarget, GrDrawTarget::TopoSortTraits>(&fDrawTargets);
SkASSERT(result);
#endif
fFlushState.reset();
+ fFlushing = false;
}
GrTextContext* GrDrawingManager::textContext(const SkSurfaceProps& props,
, fNVPRTextContext(nullptr)
, fPathRendererChain(nullptr)
, fSoftwarePathRenderer(nullptr)
- , fFlushState(context->getGpu(), context->resourceProvider()) {
+ , fFlushState(context->getGpu(), context->resourceProvider())
+ , fFlushing(false) {
sk_bzero(fTextContexts, sizeof(fTextContexts));
}
GrSoftwarePathRenderer* fSoftwarePathRenderer;
GrBatchFlushState fFlushState;
+ bool fFlushing;
};
#endif