Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SurfaceManager Class Referenceabstract

#include <SurfaceManager.h>

Inheritance diagram for SurfaceManager:
GaneshGLSurfaceManager GaneshVulkanSurfaceManager RasterSurfaceManager

Public Types

enum class  CpuOrGpu { kCPU , kGPU }
 

Public Member Functions

virtual sk_sp< SkSurfacegetSurface ()=0
 
virtual void flush ()
 
std::map< std::string, std::string > getGoldKeyValuePairs (std::string cpuName, std::string gpuName) const
 
std::map< std::string, std::string > getPerfKeyValuePairs (std::string cpuName, std::string gpuName) const
 
CpuOrGpu isCpuOrGpuBound () const
 
virtual sk_gpu_test::ContextInfogetGaneshContextInfo ()
 
virtual ~SurfaceManager ()=default
 

Static Public Member Functions

static std::unique_ptr< SurfaceManagerFromConfig (std::string config, SurfaceOptions surfaceOptions)
 

Protected Member Functions

 SurfaceManager (std::string config, SkColorInfo colorInfo, CpuOrGpu cpuOrGpu)
 

Detailed Description

Definition at line 39 of file SurfaceManager.h.

Member Enumeration Documentation

◆ CpuOrGpu

enum class SurfaceManager::CpuOrGpu
strong
Enumerator
kCPU 
kGPU 

Definition at line 41 of file SurfaceManager.h.

Constructor & Destructor Documentation

◆ ~SurfaceManager()

virtual SurfaceManager::~SurfaceManager ( )
virtualdefault

◆ SurfaceManager()

SurfaceManager::SurfaceManager ( std::string  config,
SkColorInfo  colorInfo,
CpuOrGpu  cpuOrGpu 
)
inlineprotected

Definition at line 84 of file SurfaceManager.h.

85 : fConfig(config), fColorInfo(colorInfo), fCpuOrGpu(cpuOrGpu) {}

Member Function Documentation

◆ flush()

virtual void SurfaceManager::flush ( )
inlinevirtual

Reimplemented in GaneshGLSurfaceManager, and GaneshVulkanSurfaceManager.

Definition at line 55 of file SurfaceManager.h.

55{}

◆ FromConfig()

std::unique_ptr< SurfaceManager > SurfaceManager::FromConfig ( std::string  config,
SurfaceOptions  surfaceOptions 
)
static

Definition at line 120 of file GaneshGLSurfaceManager.cpp.

121 {
122 if (config == "gles") {
124 config,
125 surfaceOptions,
131 /* sampleCount= */ 1);
132 }
133 if (config == "gles_msaa4") {
135 config,
136 surfaceOptions,
142 /* sampleCount= */ 4);
143 }
144 if (config == "gles_msaa8") {
146 config,
147 surfaceOptions,
153 /* sampleCount= */ 8);
154 }
155 if (config == "gles_msaa8_noReduceOpsTaskSplitting") {
156 GrContextOptions grContextOptions;
159 config,
160 surfaceOptions,
161 grContextOptions,
166 /* sampleCount= */ 8);
167 }
168 return nullptr;
169}
std::unique_ptr< SurfaceManager > makeGLESSurfaceManager(std::string config, SurfaceOptions surfaceOptions, GrContextOptions grContextOptions, sk_gpu_test::GrContextFactory::ContextOverrides contextOverrides, SkColorInfo colorInfo, SurfaceType surfaceType, uint32_t surfaceFlags, int sampleCount)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
static sk_sp< SkColorSpace > MakeSRGB()

◆ getGaneshContextInfo()

virtual sk_gpu_test::ContextInfo * SurfaceManager::getGaneshContextInfo ( )
inlinevirtual

Reimplemented in GaneshGLSurfaceManager, and GaneshVulkanSurfaceManager.

Definition at line 75 of file SurfaceManager.h.

75 {
76 SK_ABORT("This SurfaceManager implementation does not support the requested operation.");
77 }
#define SK_ABORT(message,...)
Definition SkAssert.h:70

◆ getGoldKeyValuePairs()

std::map< std::string, std::string > SurfaceManager::getGoldKeyValuePairs ( std::string  cpuName,
std::string  gpuName 
) const

Definition at line 125 of file SurfaceManager.cpp.

126 {
127 std::map<std::string, std::string> kvPairs = {
128 {"surface_config", fConfig},
129 {"gamut", identify_gamut(fColorInfo.colorSpace())},
130 {"transfer_fn", identify_transfer_fn(fColorInfo.colorSpace())},
131 {"color_type", std::string(ToolUtils::colortype_name(fColorInfo.colorType()))},
132 {"alpha_type", std::string(ToolUtils::alphatype_name(fColorInfo.alphaType()))},
133 {"color_depth", std::string(ToolUtils::colortype_depth(fColorInfo.colorType()))},
134 };
135 kvPairs.merge(getCpuOrGpuKeyValuePairs(cpuName, gpuName));
136 return kvPairs;
137}
static std::string identify_transfer_fn(SkColorSpace *cs)
static std::string identify_gamut(SkColorSpace *cs)
SkAlphaType alphaType() const
SkColorSpace * colorSpace() const
SkColorType colorType() const
const char * colortype_depth(SkColorType ct)
Definition ToolUtils.cpp:97
const char * colortype_name(SkColorType ct)
Definition ToolUtils.cpp:65
const char * alphatype_name(SkAlphaType at)
Definition ToolUtils.cpp:55

◆ getPerfKeyValuePairs()

std::map< std::string, std::string > SurfaceManager::getPerfKeyValuePairs ( std::string  cpuName,
std::string  gpuName 
) const

Definition at line 139 of file SurfaceManager.cpp.

140 {
141 return getCpuOrGpuKeyValuePairs(cpuName, gpuName);
142}

◆ getSurface()

virtual sk_sp< SkSurface > SurfaceManager::getSurface ( )
pure virtual

◆ isCpuOrGpuBound()

SurfaceManager::CpuOrGpu SurfaceManager::isCpuOrGpuBound ( ) const

Definition at line 160 of file SurfaceManager.cpp.

160{ return fCpuOrGpu; }

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