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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/stream_texture_manager_in_process_android.h
diff --git a/gpu/command_buffer/service/stream_texture_manager_in_process_android.h b/gpu/command_buffer/service/stream_texture_manager_in_process_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..d7d110048b7838e4e8060ee701d235d96f03fa02
--- /dev/null
+++ b/gpu/command_buffer/service/stream_texture_manager_in_process_android.h
@@ -0,0 +1,75 @@
+// Copyright (c) 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 <map>
+
+#include "base/memory/linked_ptr.h"
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/lock.h"
+#include "gpu/command_buffer/service/stream_texture.h"
+#include "gpu/command_buffer/service/stream_texture_manager.h"
+
+namespace gfx {
+class Size;
+class SurfaceTextureBridge;
+}
+
+namespace gpu {
+
+class StreamTextureManagerInProcess
+ : public gpu::StreamTextureManager,
+ public base::RefCountedThreadSafe<StreamTextureManagerInProcess> {
+ public:
+ StreamTextureManagerInProcess();
+
+ // implement gpu::StreamTextureManager:
+ virtual uint32 CreateStreamTexture(uint32 service_id,
+ uint32 client_id) OVERRIDE;
+ virtual void DestroyStreamTexture(uint32 service_id) OVERRIDE;
+ virtual gpu::StreamTexture* LookupStreamTexture(uint32 service_id) OVERRIDE;
+
+ scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture(uint32 stream_id);
+
+ private:
+ class StreamTextureImpl : public gpu::StreamTexture {
+ public:
+ StreamTextureImpl(uint32 service_id, uint32 stream_id);
+ virtual ~StreamTextureImpl();
+
+ // implement gpu::StreamTexture
+ virtual void Update() OVERRIDE;
+ virtual gfx::Size GetSize() OVERRIDE;
+
+ void SetSize(gfx::Size size);
+
+ scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture();
+ uint32 stream_id() { return stream_id_; }
+
+ private:
+ scoped_refptr<gfx::SurfaceTextureBridge> surface_texture_bridge_;
+ uint32 stream_id_;
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(StreamTextureImpl);
+ };
+
+ friend class base::RefCountedThreadSafe<StreamTextureManagerInProcess>;
+ virtual ~StreamTextureManagerInProcess();
+
+ typedef std::map<uint32, linked_ptr<StreamTextureImpl> > TextureMap;
+ TextureMap textures_;
+
+ uint32 next_id_;
+
+ base::Lock map_lock_;
+
+ DISALLOW_COPY_AND_ASSIGN(StreamTextureManagerInProcess);
+};
+
+} // gpu
+
+#endif // GPU_STREAM_TEXTURE_MANAGER_IN_PROCESS_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698