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

Unified Diff: ui/gl/android/gl_image_stream.h

Issue 22824009: Remove StreamTextureManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: ui/gl/android/gl_image_stream.h
diff --git a/ui/gl/android/gl_image_stream.h b/ui/gl/android/gl_image_stream.h
new file mode 100644
index 0000000000000000000000000000000000000000..f2b532aa37690958b3398bf52dd0bf101bd7bbbc
--- /dev/null
+++ b/ui/gl/android/gl_image_stream.h
@@ -0,0 +1,64 @@
+// 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 UI_GL_ANDROID_GL_IMAGE_STREAM_H_
+#define UI_GL_ANDROID_GL_IMAGE_STREAM_H_
+
+#include "base/callback.h"
+#include "ui/gl/gl_image.h"
+
+namespace gfx {
+class Size;
+class SurfaceTextureBridge;
+
+class GLImageStream : public GLImage {
+ public:
+ GLImageStream(uint32 texture_id);
+ virtual ~GLImageStream();
+
+ // GLImage implementation.
+ virtual void Destroy() OVERRIDE;
+ virtual gfx::Size GetSize() OVERRIDE;
+ virtual void UpdateTexImage() OVERRIDE;
+ virtual GLImageStream* AsGLImageStream() OVERRIDE { return this; }
+
+ bool BindTexImageExternal();
+ void ReleaseTexImageExternal();
+
+ void SetSize(gfx::Size size) { size_ = size; }
+
+ struct Matrix {
+ float components[16];
+ };
+ typedef base::Callback<void(const Matrix&)> MatrixChangedCallBack;
+
+ void SetMatrixChangedCallback(const MatrixChangedCallBack& callback) {
+ matrix_callback_ = callback;
+ }
+
+ void SetFrameAvailableCallback(const base::Closure& callback);
+
+ SurfaceTextureBridge* GetSurfaceTexture();
+
+ private:
+ void OnFrameAvailable();
+
+ // Current transform matrix of the surface texture.
+ Matrix current_matrix_;
+
+ // Whether the surface texture has been updated.
+ bool has_updated_;
+
+ MatrixChangedCallBack matrix_callback_;
+ base::Closure frame_callback_;
+
+ gfx::Size size_;
+ scoped_refptr<gfx::SurfaceTextureBridge> surface_texture_bridge_;
+
+ DISALLOW_COPY_AND_ASSIGN(GLImageStream);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_ANDROID_GL_IMAGE_STREAM_H_

Powered by Google App Engine
This is Rietveld 408576698