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

Side by Side Diff: content/common/gpu/stream_texture_manager_android.h

Issue 10695020: upstream SurfaceTextureListener and SurfaceTextureBridge class for android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments and add StreamTextureManagerAndroid class Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 class SurfaceTextureBridge;
19 }
20
21 // Class for managing the stream texture.
22 class StreamTextureManagerAndroid : public gpu::StreamTextureManager {
jam 2012/06/28 23:12:26 nit: put this in content namespace as well
qinmin 2012/06/28 23:57:25 Done.
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 content::SurfaceTextureBridge* bridge()
45 { return surface_texture_.get(); }
46
47 private:
48 scoped_ptr<content::SurfaceTextureBridge> surface_texture_;
49 GpuChannel* channel_;
50
51 DISALLOW_COPY_AND_ASSIGN(StreamTextureAndroid);
52 };
53
54 GpuChannel* channel_;
55
56 typedef IDMap<StreamTextureAndroid, IDMapOwnPointer> TextureMap;
57 TextureMap textures_;
58
59 DISALLOW_COPY_AND_ASSIGN(StreamTextureManagerAndroid);
60 };
61
62 #endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698