46 size_t resourceBudget)
47 : fSharedContext(sharedContext)
70 TRACE_EVENT1(
"skia.shaders",
"createGraphicsPipeline",
"desc",
76 pipeline = globalCache->addGraphicsPipeline(pipelineKey, std::move(pipeline));
90 pipeline = globalCache->addComputePipeline(pipelineKey, std::move(pipeline));
100 std::string_view label,
110 return this->findOrCreateTextureWithKey(dimensions,
129 return this->findOrCreateTextureWithKey(dimensions,
132 "DepthStencilAttachment",
150 return this->findOrCreateTextureWithKey(dimensions,
153 "DiscardableMSAAAttachment",
160 std::string_view label,
167 resource->setLabel(std::move(label));
177 tex->setLabel(std::move(label));
184 std::string_view label) {
187 texture->setLabel(std::move(label));
204 sampler->setKey(
key);
212 std::string_view label) {
219 static_assert(
sizeof(uint32_t) == 4);
220 static const int kSizeKeyNum32DataCnt = (
sizeof(size_t) + 3) / 4;
221 static const int kKeyNum32DataCnt = kSizeKeyNum32DataCnt + 1;
224 SkASSERT(
static_cast<uint32_t
>(accessPattern) < (1u << 1));
228 (
static_cast<uint32_t
>(accessPattern) << 4);
230 for (
int i = 0;
i < kSizeKeyNum32DataCnt; ++
i) {
235 if constexpr(kSizeKeyNum32DataCnt > 1) {
243 resource->setLabel(std::move(label));
252 buffer->setLabel(std::move(label));
258bool dimensions_are_valid(
const int maxTextureSize,
const SkISize& dimensions) {
260 dimensions.
width() > maxTextureSize ||
261 dimensions.
height() > maxTextureSize) {
262 SKGPU_LOG_W(
"Call to createBackendTexture has requested dimensions (%d, %d) larger than the"
263 " supported gpu max texture size: %d. Or the dimensions are empty.",
278#ifdef SK_BUILD_FOR_ANDROID
281 bool isProtectedContent,
283 bool fromAndroidWindow)
const {
296 bool isProtectedContent,
298 bool fromAndroidWindow)
const {
static int step(int x, SkScalar min, SkScalar max)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
struct AHardwareBuffer AHardwareBuffer
#define SKGPU_LOG_W(fmt,...)
static SkString resource(SkPDFResourceType type, int index)
#define TRACE_STR_COPY(str)
virtual GraphiteResourceKey makeSamplerKey(const SamplerDesc &samplerDesc) const
virtual UniqueKey makeGraphicsPipelineKey(const GraphicsPipelineDesc &, const RenderPassDesc &) const =0
virtual UniqueKey makeComputePipelineKey(const ComputePipelineDesc &) const =0
virtual void buildKeyForTexture(SkISize dimensions, const TextureInfo &, ResourceType, Shareable, GraphiteResourceKey *) const =0
int maxTextureSize() const
UniquePaintParamsID paintParamsID() const
uint32_t renderStepID() const
static ResourceType GenerateResourceType()
const RenderStep * lookup(uint32_t uniqueID) const
sk_sp< GraphicsPipeline > findOrCreateGraphicsPipeline(const RuntimeEffectDictionary *, const GraphicsPipelineDesc &, const RenderPassDesc &)
sk_sp< Texture > findOrCreateDiscardableMSAAAttachment(SkISize dimensions, const TextureInfo &)
sk_sp< ComputePipeline > findOrCreateComputePipeline(const ComputePipelineDesc &)
virtual sk_sp< Sampler > createSampler(const SamplerDesc &)=0
void purgeResourcesNotUsedSince(StdSteadyClock::time_point purgeTime)
virtual sk_sp< Buffer > createBuffer(size_t size, BufferType type, AccessPattern)=0
sk_sp< Texture > createWrappedTexture(const BackendTexture &, std::string_view label)
virtual sk_sp< Texture > onCreateWrappedTexture(const BackendTexture &)=0
sk_sp< Texture > findOrCreateScratchTexture(SkISize, const TextureInfo &, std::string_view label, skgpu::Budgeted)
virtual BackendTexture onCreateBackendTexture(SkISize dimensions, const TextureInfo &)=0
ResourceProvider(SharedContext *sharedContext, SingleOwner *singleOwner, uint32_t recorderID, size_t resourceBudget)
sk_sp< Sampler > findOrCreateCompatibleSampler(const SamplerDesc &)
BackendTexture createBackendTexture(SkISize dimensions, const TextureInfo &)
sk_sp< Texture > findOrCreateDepthStencilAttachment(SkISize dimensions, const TextureInfo &)
void deleteBackendTexture(const BackendTexture &)
virtual sk_sp< GraphicsPipeline > createGraphicsPipeline(const RuntimeEffectDictionary *, const GraphicsPipelineDesc &, const RenderPassDesc &)=0
virtual void onDeleteBackendTexture(const BackendTexture &)=0
virtual sk_sp< Texture > createTexture(SkISize, const TextureInfo &, skgpu::Budgeted)=0
virtual ~ResourceProvider()
sk_sp< Buffer > findOrCreateBuffer(size_t size, BufferType type, AccessPattern, std::string_view label)
sk_sp< ResourceCache > fResourceCache
SharedContext * fSharedContext
virtual sk_sp< ComputePipeline > createComputePipeline(const ComputePipelineDesc &)=0
const Caps * caps() const
GlobalCache * globalCache()
ShaderCodeDictionary * shaderCodeDictionary()
const RendererProvider * rendererProvider() const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
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
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
static std::string to_str(const SharedContext *ctx, const GraphicsPipelineDesc &gpDesc, const RenderPassDesc &rpDesc)
std::string GetPipelineLabel(const ShaderCodeDictionary *dict, const RenderPassDesc &renderPassDesc, const RenderStep *renderStep, UniquePaintParamsID paintID)
constexpr int32_t width() const
constexpr int32_t height() const
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)