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

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: address comments 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
« no previous file with comments | « gpu/gpu.gyp ('k') | ui/gl/android/gl_image_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e318f3c739798c94c84bf88cd3b9bfab7a7fcba2
--- /dev/null
+++ b/ui/gl/android/gl_image_stream.h
@@ -0,0 +1,67 @@
+// 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 "base/memory/weak_ptr.h"
+#include "ui/gl/gl_image.h"
+
+namespace gfx {
+class Size;
+class SurfaceTextureBridge;
+
+class GLImageStream : public GLImage {
+ public:
+ GLImageStream();
+ virtual ~GLImageStream();
+
+ // GLImage implementation.
+ virtual void Destroy() OVERRIDE;
+ virtual gfx::Size GetSize() OVERRIDE;
+ virtual void WillUseTexImage() OVERRIDE;
+ virtual bool BindTexImage() OVERRIDE;
+ virtual void ReleaseTexImage() OVERRIDE;
+
+ virtual GLImageStream* AsGLImageStream() OVERRIDE;
+
+ 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_;
+
+ base::WeakPtrFactory<GLImageStream> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(GLImageStream);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_ANDROID_GL_IMAGE_STREAM_H_
« no previous file with comments | « gpu/gpu.gyp ('k') | ui/gl/android/gl_image_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698