16size_t GrRingBuffer::getAllocationOffset(
size_t size) {
25 size_t modHead =
head & (fTotalSize - 1);
26 size_t modTail =
tail & (fTotalSize - 1);
35 if (modHead >= modTail) {
37 if (fTotalSize - modHead <
size) {
44 head += fTotalSize - modHead;
48 }
else if (modTail - modHead <
size) {
58 fNewAllocation =
true;
60 size_t offset = this->getAllocationOffset(
size);
68 fPreviousBuffers.push_back(std::move(fCurrentBuffer));
72 fCurrentBuffer = resourceProvider->
createBuffer(fTotalSize,
81 size_t offset = this->getAllocationOffset(
size);
88 for (
unsigned int i = 0;
i < fPreviousBuffers.size(); ++
i) {
89 fPreviousBuffers[
i]->unmap();
92 fPreviousBuffers.clear();
95#ifdef SK_BUILD_FOR_MAC
99 fCurrentBuffer->
unmap();
101 SubmitData* submitData =
new SubmitData();
102 submitData->fOwner =
this;
103 submitData->fLastHead = fHead;
104 submitData->fGenID = fGenID;
106 fNewAllocation =
false;
111void GrRingBuffer::FinishSubmit(
void* finishedContext) {
112 GrRingBuffer::SubmitData* submitData = (GrRingBuffer::SubmitData*)finishedContext;
113 if (submitData && submitData->fOwner && submitData->fGenID == submitData->fOwner->fGenID) {
114 submitData->fOwner->fTail = submitData->fLastHead;
115 submitData->fOwner =
nullptr;
@ kDynamic_GrAccessPattern
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
GrResourceProvider * resourceProvider()
GrDirectContextPriv priv()
GrDirectContext * getContext()
virtual void addFinishedProc(GrGpuFinishedProc finishedProc, GrGpuFinishedContext finishedContext)=0
virtual void takeOwnershipOfBuffer(sk_sp< GrGpuBuffer >)
sk_sp< GrGpuBuffer > createBuffer(size_t size, GrGpuBufferType, GrAccessPattern, ZeroInit)
void startSubmit(GrGpu *)
Slice suballocate(size_t size)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size