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

Unified Diff: include/gpu/GrContext.h

Issue 422903002: Test abandoning GL context in dm/nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix build Created 6 years, 5 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 | « dm/DMTask.cpp ('k') | include/gpu/GrContextFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index f533851ac3f377617fd34194731ac420413de5a6..103d76e8a20c3a2608deb9c10db50f3d58e0f916 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -85,24 +85,21 @@ public:
}
/**
- * Abandons all GPU resources, assumes 3D API state is unknown. Call this
- * if you have lost the associated GPU context, and thus internal texture,
- * buffer, etc. references/IDs are now invalid. Should be called even when
- * GrContext is no longer going to be used for two reasons:
+ * Abandons all GPU resources and assumes the underlying backend 3D API
+ * context is not longer usable. Call this if you have lost the associated
+ * GPU context, and thus internal texture, buffer, etc. references/IDs are
+ * now invalid. Should be called even when GrContext is no longer going to
+ * be used for two reasons:
* 1) ~GrContext will not try to free the objects in the 3D API.
- * 2) If you've created GrGpuResources that outlive the GrContext they
- * will be marked as invalid (GrGpuResource::isValid()) and won't
- * attempt to free their underlying resource in the 3D API.
- * Content drawn since the last GrContext::flush() may be lost.
+ * 2) Any GrGpuResources created by this GrContext that outlive
+ * will be marked as invalid (GrGpuResource::wasDestroyed()) and
+ * when they're destroyed no 3D API calls will be made.
+ * Content drawn since the last GrContext::flush() may be lost. After this
+ * function is called the only valid action on the GrContext or
+ * GrGpuResources it created is to destroy them.
*/
- void contextLost();
-
- /**
- * Similar to contextLost, but makes no attempt to reset state.
- * Use this method when GrContext destruction is pending, but
- * the graphics context is destroyed first.
- */
- void contextDestroyed();
+ void abandonContext();
+ void contextDestroyed() { this->abandonContext(); } // legacy alias
///////////////////////////////////////////////////////////////////////////
// Resource Cache
« no previous file with comments | « dm/DMTask.cpp ('k') | include/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698