Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: tools/gpu/GrContextFactory.cpp

Issue 1852733002: Add GrContext::releaseAndAbandonContext() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build, add null check, add unit test" Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gpu/GrContextFactory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gpu/GrContextFactory.cpp
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index bae73a4e1986a725de8f8afe7007708e7eee3777..c2321213326aed4bcd902532afd2e138dcc155e0 100755
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -63,6 +63,17 @@ void GrContextFactory::abandonContexts() {
}
}
+void GrContextFactory::releaseResourcesAndAbandonContexts() {
+ for (Context& context : fContexts) {
+ if (context.fGLContext) {
+ context.fGLContext->makeCurrent();
+ context.fGrContext->releaseResourcesAndAbandonContext();
+ delete(context.fGLContext);
+ context.fGLContext = nullptr;
+ }
+ }
+}
+
GrContextFactory::ContextInfo GrContextFactory::getContextInfo(GLContextType type,
GLContextOptions options) {
for (int i = 0; i < fContexts.count(); ++i) {
« no previous file with comments | « tools/gpu/GrContextFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698