Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skgpu::graphite::CopyTextureToBufferTask Class Referencefinal

#include <CopyTask.h>

Inheritance diagram for skgpu::graphite::CopyTextureToBufferTask:
skgpu::graphite::Task SkRefCnt SkRefCntBase

Public Member Functions

 ~CopyTextureToBufferTask () override
 
Status prepareResources (ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
 
Status addCommands (Context *, CommandBuffer *, ReplayTargetData) override
 
virtual Status prepareResources (ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *)=0
 
virtual Status addCommands (Context *, CommandBuffer *, ReplayTargetData)=0
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< CopyTextureToBufferTaskMake (sk_sp< TextureProxy >, SkIRect srcRect, sk_sp< Buffer >, size_t bufferOffset, size_t bufferRowBytes)
 

Additional Inherited Members

- Public Types inherited from skgpu::graphite::Task
enum class  Status { kSuccess , kDiscard , kFail }
 

Detailed Description

Definition at line 54 of file CopyTask.h.

Constructor & Destructor Documentation

◆ ~CopyTextureToBufferTask()

skgpu::graphite::CopyTextureToBufferTask::~CopyTextureToBufferTask ( )
override

Definition at line 90 of file CopyTask.cpp.

90{}

Member Function Documentation

◆ addCommands()

Task::Status skgpu::graphite::CopyTextureToBufferTask::addCommands ( Context ,
CommandBuffer commandBuffer,
ReplayTargetData   
)
overridevirtual

Implements skgpu::graphite::Task.

Definition at line 105 of file CopyTask.cpp.

107 {
108 if (commandBuffer->copyTextureToBuffer(fTextureProxy->refTexture(),
109 fSrcRect,
110 std::move(fBuffer),
111 fBufferOffset,
112 fBufferRowBytes)) {
113 // TODO(b/332681367): CopyTextureToBuffer is currently only used for readback operations,
114 // which are a one-time event. Should this just default to returning kDiscard?
115 return Status::kSuccess;
116 } else {
117 return Status::kFail;
118 }
119}

◆ Make()

sk_sp< CopyTextureToBufferTask > skgpu::graphite::CopyTextureToBufferTask::Make ( sk_sp< TextureProxy textureProxy,
SkIRect  srcRect,
sk_sp< Buffer buffer,
size_t  bufferOffset,
size_t  bufferRowBytes 
)
static

Definition at line 63 of file CopyTask.cpp.

67 {
68 if (!textureProxy) {
69 return nullptr;
70 }
71 return sk_sp<CopyTextureToBufferTask>(new CopyTextureToBufferTask(std::move(textureProxy),
72 srcRect,
73 std::move(buffer),
74 bufferOffset,
75 bufferRowBytes));
76}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126

◆ prepareResources()

Task::Status skgpu::graphite::CopyTextureToBufferTask::prepareResources ( ResourceProvider resourceProvider,
ScratchResourceManager ,
const RuntimeEffectDictionary  
)
overridevirtual

Implements skgpu::graphite::Task.

Definition at line 92 of file CopyTask.cpp.

94 {
95 // If the source texture hasn't been instantiated yet, it means there was no prior task that
96 // could have initialized its contents so a readback to a buffer does not make sense.
97 SkASSERT(fTextureProxy->isInstantiated() || fTextureProxy->isLazy());
98 // TODO: The copy is also a consumer of the source, so it should participate in returning
99 // scratch resources like RenderPassTask does. For now, though, all copy tasks side step reuse
100 // entirely and they cannot participate until they've been moved into scoping tasks like
101 // DrawTask first.
102 return Status::kSuccess;
103}
#define SkASSERT(cond)
Definition: SkAssert.h:116

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