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

Side by Side Diff: ui/android/java/src/org/chromium/ui/gfx/SurfaceTexturePlatformWrapper.java

Issue 62203014: Move WindowOpenDisposition.template to ui/base/android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ui.gyp Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.ui.gfx;
6
7 import android.graphics.SurfaceTexture;
8 import android.os.Build;
9
10 import org.chromium.base.CalledByNative;
11 import org.chromium.base.JNINamespace;
12
13 /**
14 * Wrapper class for the underlying platform's SurfaceTexture in order to
15 * provide a stable JNI API.
16 */
17 @JNINamespace("gfx")
18 class SurfaceTexturePlatformWrapper {
19 @CalledByNative
20 private static SurfaceTexture create(int textureId) {
21 return new SurfaceTexture(textureId);
22 }
23
24 @CalledByNative
25 private static void destroy(SurfaceTexture surfaceTexture) {
26 surfaceTexture.setOnFrameAvailableListener(null);
27 surfaceTexture.release();
28 }
29
30 @CalledByNative
31 private static void setFrameAvailableCallback(SurfaceTexture surfaceTexture,
32 int nativeSurfaceTextureListener) {
33 surfaceTexture.setOnFrameAvailableListener(
34 new SurfaceTextureListener(nativeSurfaceTextureListener));
35 }
36
37 @CalledByNative
38 private static void updateTexImage(SurfaceTexture surfaceTexture) {
39 surfaceTexture.updateTexImage();
40 }
41
42 @CalledByNative
43 private static void setDefaultBufferSize(SurfaceTexture surfaceTexture, int width,
44 int height) {
45 surfaceTexture.setDefaultBufferSize(width, height);
46 }
47
48 @CalledByNative
49 private static void getTransformMatrix(SurfaceTexture surfaceTexture, float[ ] matrix) {
50 surfaceTexture.getTransformMatrix(matrix);
51 }
52
53 @CalledByNative
54 private static void attachToGLContext(SurfaceTexture surfaceTexture, int tex Name) {
55 assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
56 surfaceTexture.attachToGLContext(texName);
57 }
58
59 @CalledByNative
60 private static void detachFromGLContext(SurfaceTexture surfaceTexture) {
61 assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
62 surfaceTexture.detachFromGLContext();
63 }
64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698