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

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

Issue 6733045: Merge 79130 - Fix bug in shader and program managers. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/696/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
===================================================================
--- gpu/command_buffer/service/shader_manager.h (revision 79346)
+++ gpu/command_buffer/service/shader_manager.h (working copy)
@@ -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,29 +78,13 @@
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(GLuint service_id, GLenum shader_type);
+ ~ShaderInfo();
- ~ShaderInfo() { }
+ void IncUseCount();
+ void DecUseCount();
+ void MarkAsDeleted();
- void IncUseCount() {
- ++use_count_;
- }
-
- void DecUseCount() {
- --use_count_;
- DCHECK_GE(use_count_, 0);
- }
-
- void MarkAsDeleted() {
- DCHECK_NE(service_id_, 0u);
- service_id_ = 0;
- }
-
int use_count_;
// The shader this ShaderInfo is tracking.
@@ -149,6 +133,9 @@
// 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