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

Unified Diff: gpu/command_buffer/service/shader_manager.h

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 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 | « gpu/command_buffer/service/gpu_tracer_unittest.cc ('k') | gpu/command_buffer/service/shader_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/shader_manager.h
diff --git a/gpu/command_buffer/service/shader_manager.h b/gpu/command_buffer/service/shader_manager.h
index 2fbe0dce77ff27e7590314cc4fd3b9a509af4613..0c48b9932f918cac2d4fd30d78bbf85d4fedaf5f 100644
--- a/gpu/command_buffer/service/shader_manager.h
+++ b/gpu/command_buffer/service/shader_manager.h
@@ -45,7 +45,7 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
}
GLuint service_id() const {
- return service_id_;
+ return marked_for_deletion_ ? 0 : service_id_;
}
GLenum shader_type() const {
@@ -97,7 +97,7 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
}
bool IsDeleted() const {
- return service_id_ == 0;
+ return marked_for_deletion_;
}
bool InUse() const {
@@ -145,15 +145,23 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
Shader(GLuint service_id, GLenum shader_type);
~Shader();
+ // Must be called only if we currently own the context. Forces the deletion
+ // of the underlying shader service id.
+ void Destroy();
+
void IncUseCount();
void DecUseCount();
- void Delete();
+ void MarkForDeletion();
+ void DeleteServiceID();
int use_count_;
// The current state of the shader.
ShaderState shader_state_;
+ // The shader has been marked for deletion.
+ bool marked_for_deletion_;
+
// The shader this Shader is tracking.
GLuint service_id_;
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer_unittest.cc ('k') | gpu/command_buffer/service/shader_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698