Add private GrContext::compile API (take 2)
Currently this is only implemented for GL.
Bug: skia:9455
Change-Id: I851471d6334d6a38e6fde3a46f09b7dc0209fb78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272346
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index 9c7115f..02c75a1 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -55,6 +55,12 @@
return nullptr;
}
+ return this->findOrCreateProgram(renderTarget, desc, programInfo);
+}
+
+sk_sp<GrGLProgram> GrGLGpu::ProgramCache::findOrCreateProgram(GrRenderTarget* renderTarget,
+ const GrProgramDesc& desc,
+ const GrProgramInfo& programInfo) {
std::unique_ptr<Entry>* entry = fMap.find(desc);
if (entry && !(*entry)->fProgram) {
// We've pre-compiled the GL program, but don't have the GrGLProgram scaffolding