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

#include <RecorderPriv.h>

Public Member Functions

void add (sk_sp< Task >)
 
void flushTrackedDevices ()
 
const Capscaps () const
 
ResourceProviderresourceProvider ()
 
const RuntimeEffectDictionaryruntimeEffectDictionary () const
 
RuntimeEffectDictionaryruntimeEffectDictionary ()
 
const ShaderCodeDictionaryshaderCodeDictionary () const
 
ShaderCodeDictionaryshaderCodeDictionary ()
 
const RendererProviderrendererProvider () const
 
Protected isProtected () const
 
UniformDataCacheuniformDataCache ()
 
TextureDataCachetextureDataCache ()
 
DrawBufferManagerdrawBufferManager ()
 
UploadBufferManageruploadBufferManager ()
 
AtlasProvideratlasProvider ()
 
TokenTrackertokenTracker ()
 
sktext::gpu::StrikeCachestrikeCache ()
 
sktext::gpu::TextBlobRedrawCoordinatortextBlobCache ()
 
ProxyCacheproxyCache ()
 
uint32_t uniqueID () const
 
size_t getResourceCacheLimit () const
 

Static Public Member Functions

static sk_sp< TextureProxyCreateCachedProxy (Recorder *, const SkBitmap &, Mipmapped=skgpu::Mipmapped::kNo)
 

Friends

class Recorder
 

Detailed Description

Definition at line 26 of file RecorderPriv.h.

Member Function Documentation

◆ add()

void skgpu::graphite::RecorderPriv::add ( sk_sp< Task task)

Definition at line 477 of file Recorder.cpp.

477 {
479 fRecorder->fRootTaskList->add(std::move(task));
480}
#define ASSERT_SINGLE_OWNER_PRIV
Definition Recorder.cpp:57

◆ atlasProvider()

AtlasProvider * skgpu::graphite::RecorderPriv::atlasProvider ( )
inline

Definition at line 61 of file RecorderPriv.h.

61{ return fRecorder->fAtlasProvider.get(); }

◆ caps()

const Caps * skgpu::graphite::RecorderPriv::caps ( ) const
inline

Definition at line 31 of file RecorderPriv.h.

31{ return fRecorder->fSharedContext->caps(); }

◆ CreateCachedProxy()

sk_sp< TextureProxy > skgpu::graphite::RecorderPriv::CreateCachedProxy ( Recorder recorder,
const SkBitmap bitmap,
Mipmapped  mipmapped = skgpu::Mipmapped::kNo 
)
static

Definition at line 536 of file Recorder.cpp.

538 {
539 SkASSERT(!bitmap.isNull());
540
541 if (!recorder) {
542 return nullptr;
543 }
544 return recorder->priv().proxyCache()->findOrCreateCachedProxy(recorder, bitmap, mipmapped);
545}
#define SkASSERT(cond)
Definition SkAssert.h:116
sk_sp< TextureProxy > findOrCreateCachedProxy(Recorder *, const SkBitmap &, Mipmapped)

◆ drawBufferManager()

DrawBufferManager * skgpu::graphite::RecorderPriv::drawBufferManager ( )
inline

Definition at line 58 of file RecorderPriv.h.

58{ return fRecorder->fDrawBufferManager.get(); }

◆ flushTrackedDevices()

void skgpu::graphite::RecorderPriv::flushTrackedDevices ( )

Definition at line 482 of file Recorder.cpp.

482 {
484
485 // If this is the initial flushTrackedDevices() call, fFlushingTrackedDevicesIndex will be -1
486 // so we start iterating at 0. We remember the starting device index to perform clean up only
487 // when it was 0 to prevent modifying the underlying data structure while iterating over it.
488 // However, when flushing one device it may register new devices as well as recursively call
489 // flushTrackedDevices(). In that case, it picks up the next device after the current one that
490 // triggered the recursive flush since all prior devices have been flushed are in progress
491 // (and they should not be flushed while in an unfinished flush). When the control flow returns
492 // to the outer flushTrackedDevices(), it will pick up with wherever the inner flush had ended.
493 // TODO(b/330864257): Once paint data is extracted at draw time (so picture shaders are rendered
494 // to images before a flush instead of inside a flush), we can simplify this and assert that
495 // flushTrackedDevices() is not recursively called and that devices are not added or removed
496 // while flushing.
497 const int startingIndex = fRecorder->fFlushingDevicesIndex;
498 while (fRecorder->fFlushingDevicesIndex < fRecorder->fTrackedDevices.size() - 1) {
499 // Advance before calling flushPendingWorkToRecorder() so that any re-entrant clal to
500 // flushTrackedDevices() will skip the current device.
501 fRecorder->fFlushingDevicesIndex++;
502 // Entries may be set to null from a call to deregisterDevice(), which will be cleaned up
503 // along with any immutable or uniquely held Devices once everything is flushed.
504 Device* device = fRecorder->fTrackedDevices[fRecorder->fFlushingDevicesIndex].get();
505 if (device) {
506 device->flushPendingWorkToRecorder(fRecorder);
507 }
508 }
509
510 // Issue next upload flush token. This is only used by the atlasing code which
511 // always uses this method. Calling in Device::flushPendingWorkToRecorder may
512 // miss parent device flushes, increment too often, and lead to atlas corruption.
513 this->tokenTracker()->issueFlushToken();
514
515 if (startingIndex < 0) {
516 // Initial call to flushTrackedDevices() so cleanup null/immutable devices and reset the
517 // loop index.
518 int i = 0;
519 while (i < fRecorder->fTrackedDevices.size()) {
520 Device* device = fRecorder->fTrackedDevices[i].get();
521 if (!device || !device->recorder() || device->unique()) {
522 if (device) {
523 device->abandonRecorder(); // Keep ~Device() happy
524 }
525 fRecorder->fTrackedDevices.removeShuffle(i);
526 // Keep i as-is to process what was just shuffled to the ith index.
527 } else {
528 i++;
529 }
530 }
531
532 fRecorder->fFlushingDevicesIndex = -1;
533 }
534}
TokenTracker * tokenTracker()
VkDevice device
Definition main.cc:53

◆ getResourceCacheLimit()

size_t skgpu::graphite::RecorderPriv::getResourceCacheLimit ( ) const

Definition at line 547 of file Recorder.cpp.

547 {
548 return fRecorder->fResourceProvider->getResourceCacheLimit();
549}

◆ isProtected()

Protected skgpu::graphite::RecorderPriv::isProtected ( ) const
inline

Definition at line 52 of file RecorderPriv.h.

52 {
53 return fRecorder->fSharedContext->isProtected();
54 }

◆ proxyCache()

ProxyCache * skgpu::graphite::RecorderPriv::proxyCache ( )
inline

Definition at line 67 of file RecorderPriv.h.

67{ return this->resourceProvider()->proxyCache(); }
ResourceProvider * resourceProvider()

◆ rendererProvider()

const RendererProvider * skgpu::graphite::RecorderPriv::rendererProvider ( ) const
inline

Definition at line 48 of file RecorderPriv.h.

48 {
49 return fRecorder->fSharedContext->rendererProvider();
50 }

◆ resourceProvider()

ResourceProvider * skgpu::graphite::RecorderPriv::resourceProvider ( )
inline

Definition at line 33 of file RecorderPriv.h.

33{ return fRecorder->fResourceProvider.get(); }

◆ runtimeEffectDictionary() [1/2]

RuntimeEffectDictionary * skgpu::graphite::RecorderPriv::runtimeEffectDictionary ( )
inline

Definition at line 38 of file RecorderPriv.h.

38 {
39 return fRecorder->fRuntimeEffectDict.get();
40 }

◆ runtimeEffectDictionary() [2/2]

const RuntimeEffectDictionary * skgpu::graphite::RecorderPriv::runtimeEffectDictionary ( ) const
inline

Definition at line 35 of file RecorderPriv.h.

35 {
36 return fRecorder->fRuntimeEffectDict.get();
37 }

◆ shaderCodeDictionary() [1/2]

ShaderCodeDictionary * skgpu::graphite::RecorderPriv::shaderCodeDictionary ( )
inline

Definition at line 44 of file RecorderPriv.h.

44 {
45 return fRecorder->fSharedContext->shaderCodeDictionary();
46 }

◆ shaderCodeDictionary() [2/2]

const ShaderCodeDictionary * skgpu::graphite::RecorderPriv::shaderCodeDictionary ( ) const
inline

Definition at line 41 of file RecorderPriv.h.

41 {
42 return fRecorder->fSharedContext->shaderCodeDictionary();
43 }

◆ strikeCache()

sktext::gpu::StrikeCache * skgpu::graphite::RecorderPriv::strikeCache ( )
inline

Definition at line 63 of file RecorderPriv.h.

63{ return fRecorder->fStrikeCache.get(); }

◆ textBlobCache()

sktext::gpu::TextBlobRedrawCoordinator * skgpu::graphite::RecorderPriv::textBlobCache ( )
inline

Definition at line 64 of file RecorderPriv.h.

64 {
65 return fRecorder->fTextBlobCache.get();
66 }

◆ textureDataCache()

TextureDataCache * skgpu::graphite::RecorderPriv::textureDataCache ( )
inline

Definition at line 57 of file RecorderPriv.h.

57{ return fRecorder->fTextureDataCache.get(); }

◆ tokenTracker()

TokenTracker * skgpu::graphite::RecorderPriv::tokenTracker ( )
inline

Definition at line 62 of file RecorderPriv.h.

62{ return fRecorder->fTokenTracker.get(); }

◆ uniformDataCache()

UniformDataCache * skgpu::graphite::RecorderPriv::uniformDataCache ( )
inline

Definition at line 56 of file RecorderPriv.h.

56{ return fRecorder->fUniformDataCache.get(); }

◆ uniqueID()

uint32_t skgpu::graphite::RecorderPriv::uniqueID ( ) const
inline

Definition at line 73 of file RecorderPriv.h.

73{ return fRecorder->fUniqueID; }

◆ uploadBufferManager()

UploadBufferManager * skgpu::graphite::RecorderPriv::uploadBufferManager ( )
inline

Definition at line 59 of file RecorderPriv.h.

59{ return fRecorder->fUploadBufferManager.get(); }

Friends And Related Symbol Documentation

◆ Recorder

friend class Recorder
friend

Definition at line 99 of file RecorderPriv.h.


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