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

Side by Side Diff: gpu/command_buffer/service/stream_texture_manager_in_process_android.h

Issue 23234003: Support stream textures with the synchronous compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android clang Created 7 years, 4 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) 2013 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 GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_
6 #define GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_
7
8 #include <map>
9
10 #include "base/memory/linked_ptr.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/synchronization/lock.h"
13 #include "gpu/command_buffer/service/stream_texture.h"
14 #include "gpu/command_buffer/service/stream_texture_manager.h"
15
16 namespace gfx {
17 class Size;
18 class SurfaceTextureBridge;
19 }
20
21 namespace gpu {
22
23 class StreamTextureManagerInProcess
24 : public gpu::StreamTextureManager,
25 public base::RefCountedThreadSafe<StreamTextureManagerInProcess> {
26 public:
27 StreamTextureManagerInProcess();
28
29 // implement gpu::StreamTextureManager:
30 virtual uint32 CreateStreamTexture(uint32 service_id,
31 uint32 client_id) OVERRIDE;
32 virtual void DestroyStreamTexture(uint32 service_id) OVERRIDE;
33 virtual gpu::StreamTexture* LookupStreamTexture(uint32 service_id) OVERRIDE;
34
35 scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture(uint32 stream_id);
36
37 private:
38 class StreamTextureImpl : public gpu::StreamTexture {
39 public:
40 StreamTextureImpl(uint32 service_id, uint32 stream_id);
41 virtual ~StreamTextureImpl();
42
43 // implement gpu::StreamTexture
44 virtual void Update() OVERRIDE;
45 virtual gfx::Size GetSize() OVERRIDE;
46
47 void SetSize(gfx::Size size);
48
49 scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture();
50 uint32 stream_id() { return stream_id_; }
51
52 private:
53 scoped_refptr<gfx::SurfaceTextureBridge> surface_texture_bridge_;
54 uint32 stream_id_;
55 gfx::Size size_;
56
57 DISALLOW_COPY_AND_ASSIGN(StreamTextureImpl);
58 };
59
60 friend class base::RefCountedThreadSafe<StreamTextureManagerInProcess>;
61 virtual ~StreamTextureManagerInProcess();
62
63 typedef std::map<uint32, linked_ptr<StreamTextureImpl> > TextureMap;
64 TextureMap textures_;
65
66 uint32 next_id_;
67
68 base::Lock map_lock_;
69
70 DISALLOW_COPY_AND_ASSIGN(StreamTextureManagerInProcess);
71 };
72
73 } // gpu
74
75 #endif // GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698