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

Unified Diff: ui/gl/gpu_timing.cc

Issue 1135943002: Pull in various gpu/command_buffer fixes from chromium (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « ui/gl/gpu_timing.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gpu_timing.cc
diff --git a/ui/gl/gpu_timing.cc b/ui/gl/gpu_timing.cc
index a84d3f76497bffe19efabfe78a30ecaab3a2f35c..ee9049093471973237c85fada92bd5f66300fca4 100644
--- a/ui/gl/gpu_timing.cc
+++ b/ui/gl/gpu_timing.cc
@@ -44,7 +44,16 @@ uint32_t GPUTiming::GetDisjointCount() {
}
GPUTimer::~GPUTimer() {
- glDeleteQueries(2, queries_);
+ // Destroy() must be called before the destructor.
+ DCHECK(queries_[0] == 0);
+ DCHECK(queries_[1] == 0);
+}
+
+void GPUTimer::Destroy(bool have_context) {
+ if (have_context) {
+ glDeleteQueries(2, queries_);
+ }
+ memset(queries_, 0, sizeof(queries_));
}
void GPUTimer::Start() {
« no previous file with comments | « ui/gl/gpu_timing.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698