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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java

Issue 2032963002: WIP - OpenGL Native Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into gl Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 package org.chromium.chromoting.jni; 5 package org.chromium.chromoting.jni;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 8
9 import org.chromium.base.ContextUtils; 9 import org.chromium.base.ContextUtils;
10 import org.chromium.base.Log; 10 import org.chromium.base.Log;
(...skipping 27 matching lines...) Expand all
38 sLoggerTokenConsumer = new OAuthTokenConsumer(context.getApplicationCont ext(), TOKEN_SCOPE); 38 sLoggerTokenConsumer = new OAuthTokenConsumer(context.getApplicationCont ext(), TOKEN_SCOPE);
39 System.loadLibrary("remoting_client_jni"); 39 System.loadLibrary("remoting_client_jni");
40 ContextUtils.initApplicationContextForNative(); 40 ContextUtils.initApplicationContextForNative();
41 nativeLoadNative(); 41 nativeLoadNative();
42 } 42 }
43 43
44 public static void setAccountForLogging(String account) { 44 public static void setAccountForLogging(String account) {
45 sAccount = account; 45 sAccount = account;
46 } 46 }
47 47
48 public static void useOpenGlRenderer(boolean useOpenGl) {
49 nativeUseOpenGlRenderer(useOpenGl);
50 }
51
48 @CalledByNative 52 @CalledByNative
49 private static void fetchAuthToken() { 53 private static void fetchAuthToken() {
50 if (sAccount == null) { 54 if (sAccount == null) {
51 throw new IllegalStateException("Account is not set before fetching the auth token."); 55 throw new IllegalStateException("Account is not set before fetching the auth token.");
52 } 56 }
53 sLoggerTokenConsumer.consume(sAccount, new OAuthTokenFetcher.Callback() { 57 sLoggerTokenConsumer.consume(sAccount, new OAuthTokenFetcher.Callback() {
54 @Override 58 @Override
55 public void onTokenFetched(String token) { 59 public void onTokenFetched(String token) {
56 nativeOnAuthTokenFetched(token); 60 nativeOnAuthTokenFetched(token);
57 } 61 }
58 62
59 @Override 63 @Override
60 public void onError(OAuthTokenFetcher.Error error) { 64 public void onError(OAuthTokenFetcher.Error error) {
61 Log.e(TAG, "Failed to fetch auth token for native client."); 65 Log.e(TAG, "Failed to fetch auth token for native client.");
62 } 66 }
63 }); 67 });
64 } 68 }
65 69
66 /** Performs the native portion of the initialization. */ 70 /** Performs the native portion of the initialization. */
67 private static native void nativeLoadNative(); 71 private static native void nativeLoadNative();
68 72
69 /** Notifies the native client with the new auth token */ 73 /** Notifies the native client with the new auth token */
70 private static native void nativeOnAuthTokenFetched(String token); 74 private static native void nativeOnAuthTokenFetched(String token);
75
76 private static native void nativeUseOpenGlRenderer(boolean useOpenGl);
71 } 77 }
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/jni/GlDisplay.java ('k') | remoting/client/jni/chromoting_jni_runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698