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(gfx::GLImage* image, int32 service_id) { 19 gl_images_[service_id] = image; 20 } 21 22 void ImageManager::RemoveImage(int32 service_id) { 23 gl_images_.erase(service_id); 24 } 25 26 gfx::GLImage* ImageManager::LookupImage(int32 service_id) { 27 GLImageMap::const_iterator iter = gl_images_.find(service_id); 28 if (iter != gl_images_.end()) 29 return iter->second.get(); 30 31 return NULL; 32 } 33 34 } // namespace gles2 35 } // namespace gpu 36