Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
skgpu::graphite::DrawWriter::Vertices Class Reference

#include <DrawWriter.h>

Inheritance diagram for skgpu::graphite::DrawWriter::Vertices:
skgpu::graphite::DrawWriter::Appender

Public Member Functions

 Vertices (DrawWriter &w)
 
void reserve (unsigned int count)
 
VertexWriter append (unsigned int count)
 

Detailed Description

Definition at line 321 of file DrawWriter.h.

Constructor & Destructor Documentation

◆ Vertices()

skgpu::graphite::DrawWriter::Vertices::Vertices ( DrawWriter w)
inline

Definition at line 323 of file DrawWriter.h.

323 : Appender(w, Target::kVertices) {
324 w.setTemplate(w.fVertices, {}, {}, 0);
325 }
SkScalar w

Member Function Documentation

◆ append()

VertexWriter skgpu::graphite::DrawWriter::Appender::append ( unsigned int  count)
inline

Definition at line 301 of file DrawWriter.h.

301 {
302 SkASSERT(count > 0);
303 this->reserve(count);
304
305 const size_t size = count * fStride;
307 // If the GPU mapped buffer failed, ensure we have a sufficiently large CPU address to
308 // write to so that RenderSteps don't have to worry about error handling. The Recording
309 // will fail since the map failure is tracked by BufferManager.
310 return VertexWriter(fDrawer.fFailureStorage.reset(size, SkAutoMalloc::kReuse_OnShrink),
311 size);
312 }
313
316 fDrawer.fPendingCount += count;
317 return std::exchange(fNextWriter, fNextWriter.makeOffset(size));
318 }
int count
#define SkASSERT(cond)
Definition SkAssert.h:116
#define SK_UNLIKELY
Definition SkAssert.h:28
void * reset(size_t size=0, OnShrink shrink=kAlloc_OnShrink)
void reserve(unsigned int count)
Definition DrawWriter.h:274
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
Definition switches.h:259
VertexWriter makeOffset(size_t offsetInBytes) const

◆ reserve()

void skgpu::graphite::DrawWriter::Appender::reserve ( unsigned int  count)
inline

Definition at line 274 of file DrawWriter.h.

274 {
275 if (fReservedCount >= count) {
276 return;
277 } else if (fReservedCount > 0) {
278 // Have contiguous bytes that can't satisfy request, so return them in the event the
279 // DBM has additional contiguous bytes after the prior reserved range.
281 }
282
284 // NOTE: Cannot bind tuple directly to fNextWriter, compilers don't produce the right
285 // move assignment.
286 auto [writer, reservedChunk] = fDrawer.fManager->getVertexWriter(count * fStride);
287 if (reservedChunk.fBuffer != fTarget.fBuffer ||
288 reservedChunk.fOffset !=
289 (fTarget.fOffset + (fDrawer.fPendingBase + fDrawer.fPendingCount) * fStride)) {
290 // Not contiguous, so flush and update binding to 'reservedChunk'
291 this->onFlush();
292 fDrawer.flush();
293
294 fTarget = reservedChunk;
295 fDrawer.fPendingBase = 0;
296 fDrawer.fPendingBufferBinds = true;
297 }
298 fNextWriter = std::move(writer);
299 }
std::pair< VertexWriter, BindBufferInfo > getVertexWriter(size_t requiredBytes)
void returnVertexBytes(size_t unusedBytes)

The documentation for this class was generated from the following file: