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

Side by Side Diff: ui/gl/android/scoped_java_surface.h

Issue 2047633002: Revert of Remove base/move.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « styleguide/c++/c++11.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GL_ANDROID_SCOPED_JAVA_SURFACE_H_ 5 #ifndef UI_GL_ANDROID_SCOPED_JAVA_SURFACE_H_
6 #define UI_GL_ANDROID_SCOPED_JAVA_SURFACE_H_ 6 #define UI_GL_ANDROID_SCOPED_JAVA_SURFACE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
11 #include "base/macros.h" 11 #include "base/move.h"
12 #include "ui/gl/gl_export.h" 12 #include "ui/gl/gl_export.h"
13 13
14 namespace gl { 14 namespace gl {
15 15
16 class SurfaceTexture; 16 class SurfaceTexture;
17 17
18 // A helper class for holding a scoped reference to a Java Surface instance. 18 // A helper class for holding a scoped reference to a Java Surface instance.
19 // When going out of scope, Surface.release() is called on the Java object to 19 // When going out of scope, Surface.release() is called on the Java object to
20 // make sure server-side references (esp. wrt graphics memory) are released. 20 // make sure server-side references (esp. wrt graphics memory) are released.
21 class GL_EXPORT ScopedJavaSurface { 21 class GL_EXPORT ScopedJavaSurface {
22 MOVE_ONLY_TYPE_FOR_CPP_03(ScopedJavaSurface);
23
22 public: 24 public:
23 ScopedJavaSurface(); 25 ScopedJavaSurface();
24 26
25 // Wraps an existing Java Surface object in a ScopedJavaSurface. 27 // Wraps an existing Java Surface object in a ScopedJavaSurface.
26 explicit ScopedJavaSurface(const base::android::JavaRef<jobject>& surface); 28 explicit ScopedJavaSurface(const base::android::JavaRef<jobject>& surface);
27 29
28 // Creates a Java Surface from a SurfaceTexture and wraps it in a 30 // Creates a Java Surface from a SurfaceTexture and wraps it in a
29 // ScopedJavaSurface. 31 // ScopedJavaSurface.
30 explicit ScopedJavaSurface(const SurfaceTexture* surface_texture); 32 explicit ScopedJavaSurface(const SurfaceTexture* surface_texture);
31 33
(...skipping 20 matching lines...) Expand all
52 } 54 }
53 55
54 private: 56 private:
55 // Performs destructive move from |other| to this. 57 // Performs destructive move from |other| to this.
56 void MoveFrom(ScopedJavaSurface& other); 58 void MoveFrom(ScopedJavaSurface& other);
57 59
58 bool auto_release_; 60 bool auto_release_;
59 bool is_protected_; 61 bool is_protected_;
60 62
61 base::android::ScopedJavaGlobalRef<jobject> j_surface_; 63 base::android::ScopedJavaGlobalRef<jobject> j_surface_;
62
63 DISALLOW_COPY_AND_ASSIGN(ScopedJavaSurface);
64 }; 64 };
65 65
66 } // namespace gl 66 } // namespace gl
67 67
68 #endif // UI_GL_ANDROID_SCOPED_JAVA_SURFACE_H_ 68 #endif // UI_GL_ANDROID_SCOPED_JAVA_SURFACE_H_
OLDNEW
« no previous file with comments | « styleguide/c++/c++11.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698