OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_ |
| 6 #define CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/id_map.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "gpu/command_buffer/service/stream_texture.h" |
| 13 #include "gpu/command_buffer/service/stream_texture_manager.h" |
| 14 |
| 15 class GpuChannel; |
| 16 |
| 17 namespace content { |
| 18 |
| 19 class SurfaceTextureBridge; |
| 20 |
| 21 // Class for managing the stream texture. |
| 22 class StreamTextureManagerAndroid : public gpu::StreamTextureManager { |
| 23 public: |
| 24 StreamTextureManagerAndroid(GpuChannel* channel); |
| 25 virtual ~StreamTextureManagerAndroid(); |
| 26 |
| 27 // implement gpu::StreamTextureManager: |
| 28 GLuint CreateStreamTexture(uint32 service_id, |
| 29 uint32 client_id) OVERRIDE; |
| 30 void DestroyStreamTexture(uint32 service_id) OVERRIDE; |
| 31 gpu::StreamTexture* LookupStreamTexture(uint32 service_id) OVERRIDE; |
| 32 |
| 33 private: |
| 34 // The stream texture class for android. |
| 35 class StreamTextureAndroid |
| 36 : public gpu::StreamTexture, |
| 37 public base::SupportsWeakPtr<StreamTextureAndroid> { |
| 38 public: |
| 39 StreamTextureAndroid(GpuChannel* channel, int service_id); |
| 40 virtual ~StreamTextureAndroid(); |
| 41 |
| 42 void Update() OVERRIDE; |
| 43 |
| 44 SurfaceTextureBridge* bridge() { return surface_texture_.get(); } |
| 45 |
| 46 private: |
| 47 scoped_ptr<SurfaceTextureBridge> surface_texture_; |
| 48 GpuChannel* channel_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(StreamTextureAndroid); |
| 51 }; |
| 52 |
| 53 GpuChannel* channel_; |
| 54 |
| 55 typedef IDMap<StreamTextureAndroid, IDMapOwnPointer> TextureMap; |
| 56 TextureMap textures_; |
| 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(StreamTextureManagerAndroid); |
| 59 }; |
| 60 |
| 61 } // namespace content |
| 62 |
| 63 #endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_ |
OLD | NEW |