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

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

Issue 6721010: Fix bug in shader and program managers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
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 548a9654b08b61fc63bfb3be50eb715516a95503..a39630c93ad7d61bc32bb51c58e67bf965574e80 100644
--- a/gpu/command_buffer/service/shader_manager.h
+++ b/gpu/command_buffer/service/shader_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -78,28 +78,12 @@ class ShaderManager {
friend class base::RefCounted<ShaderInfo>;
friend class ShaderManager;
- ShaderInfo(GLuint service_id, GLenum shader_type)
- : use_count_(0),
- service_id_(service_id),
- shader_type_(shader_type),
- valid_(false) {
- }
-
- ~ShaderInfo() { }
+ ShaderInfo(GLuint service_id, GLenum shader_type);
+ ~ShaderInfo();
- void IncUseCount() {
- ++use_count_;
- }
-
- void DecUseCount() {
- --use_count_;
- DCHECK_GE(use_count_, 0);
- }
-
- void MarkAsDeleted() {
- DCHECK_NE(service_id_, 0u);
- service_id_ = 0;
- }
+ void IncUseCount();
+ void DecUseCount();
+ void MarkAsDeleted();
int use_count_;
@@ -149,6 +133,9 @@ class ShaderManager {
// then we free the info.
void UnuseShader(ShaderInfo* info);
+ // Check if a ShaderInfo is owned by this ShaderManager.
+ bool IsOwned(ShaderInfo* info);
+
private:
// Info for each shader by service side shader Id.
typedef std::map<GLuint, ShaderInfo::Ref> ShaderInfoMap;
« no previous file with comments | « gpu/command_buffer/service/program_manager_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