summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/buffer_manager.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 23:03:47 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 23:03:47 +0000
commita93bb846c70d2491171bd7211d24f6f0fa56e853 (patch)
tree8cb20ea75cf5f9a175d756d0605ddaa302f6d751 /gpu/command_buffer/service/buffer_manager.cc
parent024d468c601e94f26717c1ddc68f68cfcdf4c23c (diff)
downloadchromium_src-a93bb846c70d2491171bd7211d24f6f0fa56e853.zip
chromium_src-a93bb846c70d2491171bd7211d24f6f0fa56e853.tar.gz
chromium_src-a93bb846c70d2491171bd7211d24f6f0fa56e853.tar.bz2
Adds texture tracking.
I need to add a bunch more unit tests for the TextureManager but this CL is getting large so if you don't mind I'll do that in the next CL. I still need to use the texture tracking at draw time but that's going to require uniform tracking! UGH! Also breaks out a bunch of the tracking classes into their own files. TEST=none BUG=none Review URL: http://codereview.chromium.org/605018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/buffer_manager.cc')
-rw-r--r--gpu/command_buffer/service/buffer_manager.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc
new file mode 100644
index 0000000..3509b86
--- /dev/null
+++ b/gpu/command_buffer/service/buffer_manager.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2010 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.
+
+#include "gpu/command_buffer/service/buffer_manager.h"
+#include "base/logging.h"
+
+namespace gpu {
+namespace gles2 {
+
+void BufferManager::CreateBufferInfo(GLuint buffer) {
+ std::pair<BufferInfoMap::iterator, bool> result =
+ buffer_infos_.insert(std::make_pair(buffer, BufferInfo()));
+ DCHECK(result.second);
+}
+
+BufferManager::BufferInfo* BufferManager::GetBufferInfo(
+ GLuint buffer) {
+ BufferInfoMap::iterator it = buffer_infos_.find(buffer);
+ return it != buffer_infos_.end() ? &it->second : NULL;
+}
+
+void BufferManager::RemoveBufferInfo(GLuint buffer_id) {
+ buffer_infos_.erase(buffer_id);
+}
+
+GLuint BufferManager::BufferInfo::GetMaxValueForRange(
+ GLuint offset, GLsizei count, GLenum type) {
+ // TODO(gman): Scan the values in the given range and cache their results.
+ return 0u;
+}
+
+} // namespace gles2
+} // namespace gpu
+
+