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

Unified 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: fixing nits Created 8 years, 6 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: content/common/gpu/stream_texture_manager_android.h
diff --git a/content/common/gpu/stream_texture_manager_android.h b/content/common/gpu/stream_texture_manager_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..5366dd0b8ff267a8027d30d9c856afee9df6a94c
--- /dev/null
+++ b/content/common/gpu/stream_texture_manager_android.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2011 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 CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_
+#define CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_
+#pragma once
+
+#include "base/id_map.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "gpu/command_buffer/service/stream_texture.h"
+#include "gpu/command_buffer/service/stream_texture_manager.h"
+
+class GpuChannel;
+
+namespace content {
+
+class SurfaceTextureBridge;
+
+// Class for managing the stream texture.
+class StreamTextureManagerAndroid : public gpu::StreamTextureManager {
+ public:
+ StreamTextureManagerAndroid(GpuChannel* channel);
+ virtual ~StreamTextureManagerAndroid();
+
+ // implement gpu::StreamTextureManager:
+ GLuint CreateStreamTexture(uint32 service_id,
+ uint32 client_id) OVERRIDE;
+ void DestroyStreamTexture(uint32 service_id) OVERRIDE;
+ gpu::StreamTexture* LookupStreamTexture(uint32 service_id) OVERRIDE;
+
+ private:
+ // The stream texture class for android.
+ class StreamTextureAndroid
+ : public gpu::StreamTexture,
+ public base::SupportsWeakPtr<StreamTextureAndroid> {
+ public:
+ StreamTextureAndroid(GpuChannel* channel, int service_id);
+ virtual ~StreamTextureAndroid();
+
+ void Update() OVERRIDE;
+
+ SurfaceTextureBridge* bridge() { return surface_texture_.get(); }
+
+ private:
+ scoped_ptr<SurfaceTextureBridge> surface_texture_;
+ GpuChannel* channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(StreamTextureAndroid);
+ };
+
+ GpuChannel* channel_;
+
+ typedef IDMap<StreamTextureAndroid, IDMapOwnPointer> TextureMap;
+ TextureMap textures_;
+
+ DISALLOW_COPY_AND_ASSIGN(StreamTextureManagerAndroid);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_STREAM_TEXTURE_MANAGER_ANDROID_H_
« no previous file with comments | « content/common/android/surface_texture_listener.cc ('k') | content/common/gpu/stream_texture_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698