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

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

Issue 2132883002: [Remoting Android] Placeholder for DesktopView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.graphics.Bitmap; 8 import android.graphics.Bitmap;
8 import android.graphics.Point; 9 import android.graphics.Point;
9 import android.os.Looper; 10 import android.os.Looper;
10 11
11 import org.chromium.base.Log; 12 import org.chromium.base.Log;
12 import org.chromium.base.annotations.CalledByNative; 13 import org.chromium.base.annotations.CalledByNative;
13 import org.chromium.base.annotations.JNINamespace; 14 import org.chromium.base.annotations.JNINamespace;
15 import org.chromium.chromoting.DesktopView;
16 import org.chromium.chromoting.DesktopViewFactory;
17 import org.chromium.chromoting.DesktopViewInterface;
14 18
15 import java.nio.ByteBuffer; 19 import java.nio.ByteBuffer;
16 import java.nio.ByteOrder; 20 import java.nio.ByteOrder;
17 21
18 /** 22 /**
19 * This class is for drawing the desktop on the canvas and controlling the lifet ime of the 23 * This class is for drawing the desktop on the canvas and controlling the lifet ime of the
20 * corresponding C++ object. It only draws the desktop on the graphics (=display ) thread but also 24 * corresponding C++ object. It only draws the desktop on the graphics (=display ) thread but also
21 * has functions accessible on UI thread. 25 * has functions accessible on UI thread.
22 */ 26 */
23 @JNINamespace("remoting") 27 @JNINamespace("remoting")
24 public class Display { 28 public class Display implements DesktopViewFactory {
25 private static final String TAG = "Chromoting"; 29 private static final String TAG = "Chromoting";
26 30
27 // Pointer to the C++ object. Casted to |long|. 31 // Pointer to the C++ object. Casted to |long|.
28 private long mNativeJniDisplayHandler; 32 private long mNativeJniDisplayHandler;
29 33
30 /** 34 /**
31 * Callback invoked on the graphics thread to repaint the desktop. Read on t he UI and 35 * Callback invoked on the graphics thread to repaint the desktop. Read on t he UI and
32 * graphics threads. Write only on the UI thread. 36 * graphics threads. Write only on the UI thread.
33 */ 37 */
34 private Runnable mRedrawCallback; 38 private Runnable mRedrawCallback;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return mCursorBitmap; 176 return mCursorBitmap;
173 } 177 }
174 178
175 @CalledByNative 179 @CalledByNative
176 private static Display createJavaDisplayObject(long nativeDisplayHandler) { 180 private static Display createJavaDisplayObject(long nativeDisplayHandler) {
177 return new Display(nativeDisplayHandler); 181 return new Display(nativeDisplayHandler);
178 } 182 }
179 183
180 /** Schedules a redraw on the native graphics thread. */ 184 /** Schedules a redraw on the native graphics thread. */
181 private native void nativeScheduleRedraw(long nativeJniDisplayHandler); 185 private native void nativeScheduleRedraw(long nativeJniDisplayHandler);
186
187 @Override
188 public DesktopViewInterface createDesktopView(Context context) {
189 return new DesktopView(context);
190 }
182 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698