| // Copyright 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. |
| #ifndef GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_ |
| #define GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/synchronization/lock.h" |
| #include "base/threading/non_thread_safe.h" |
| class StreamTextureManagerInProcess : public base::NonThreadSafe { |
| StreamTextureManagerInProcess(); |
| ~StreamTextureManagerInProcess(); |
| uint32 CreateStreamTexture(uint32 client_texture_id, |
| gles2::TextureManager* texture_manager); |
| // This method can be called from any thread. |
| scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture(uint32 stream_id); |
| void OnReleaseStreamTexture(uint32 stream_id); |
| typedef std::map<uint32, scoped_refptr<gfx::SurfaceTexture> > TextureMap; |
| base::WeakPtrFactory<StreamTextureManagerInProcess> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(StreamTextureManagerInProcess); |
| #endif // GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_ |