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

Unified Diff: gpu/command_buffer/client/gpu_memory_buffer_tracker.cc

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 years, 2 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/client/gpu_memory_buffer_tracker.h ('k') | gpu/command_buffer/cmd_buffer_functions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc b/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
deleted file mode 100644
index 9ffe0e33e2d4410fadfc9e4f0fe499ca2149ad1a..0000000000000000000000000000000000000000
--- a/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2013 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/client/gpu_memory_buffer_tracker.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
-#include "gpu/command_buffer/client/gpu_control.h"
-
-namespace gpu {
-namespace gles2 {
-
-GpuMemoryBufferTracker::GpuMemoryBufferTracker(GpuControl* gpu_control)
- : gpu_control_(gpu_control) {
-}
-
-GpuMemoryBufferTracker::~GpuMemoryBufferTracker() {
- while (!buffers_.empty()) {
- RemoveBuffer(buffers_.begin()->first);
- }
-}
-
-int32 GpuMemoryBufferTracker::CreateBuffer(size_t width,
- size_t height,
- int32 internalformat,
- int32 usage) {
- int32 image_id = 0;
- DCHECK(gpu_control_);
- gfx::GpuMemoryBuffer* buffer = gpu_control_->CreateGpuMemoryBuffer(
- width, height, internalformat, usage, &image_id);
- if (!buffer)
- return 0;
-
- std::pair<BufferMap::iterator, bool> result =
- buffers_.insert(std::make_pair(image_id, buffer));
- DCHECK(result.second);
-
- return image_id;
-}
-
-gfx::GpuMemoryBuffer* GpuMemoryBufferTracker::GetBuffer(int32 image_id) {
- BufferMap::iterator it = buffers_.find(image_id);
- return (it != buffers_.end()) ? it->second : NULL;
-}
-
-void GpuMemoryBufferTracker::RemoveBuffer(int32 image_id) {
- BufferMap::iterator buffer_it = buffers_.find(image_id);
- if (buffer_it != buffers_.end())
- buffers_.erase(buffer_it);
- DCHECK(gpu_control_);
- gpu_control_->DestroyGpuMemoryBuffer(image_id);
-}
-
-} // namespace gles2
-} // namespace gpu
« no previous file with comments | « gpu/command_buffer/client/gpu_memory_buffer_tracker.h ('k') | gpu/command_buffer/cmd_buffer_functions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698