OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "gpu/command_buffer/service/image_manager.h" |
| 6 |
| 7 #include "ui/gl/gl_image.h" |
| 8 |
| 9 namespace gpu { |
| 10 namespace gles2 { |
| 11 |
| 12 ImageManager::ImageManager() { |
| 13 } |
| 14 |
| 15 ImageManager::~ImageManager() { |
| 16 } |
| 17 |
| 18 void ImageManager::AddImage( |
| 19 scoped_refptr<gfx::GLImage> image, int32 service_id) { |
| 20 gl_images_[service_id] = image; |
| 21 } |
| 22 |
| 23 void ImageManager::RemoveImage(int32 service_id) { |
| 24 gl_images_.erase(service_id); |
| 25 } |
| 26 |
| 27 scoped_refptr<gfx::GLImage> ImageManager::LookupImage(int32 service_id) { |
| 28 GLImageMap::const_iterator iter = gl_images_.find(service_id); |
| 29 if (iter != gl_images_.end()) |
| 30 return iter->second; |
| 31 |
| 32 return NULL; |
| 33 } |
| 34 |
| 35 } // namespace gles2 |
| 36 } // namespace gpu |
OLD | NEW |