| OLD | NEW |
| 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; | 5 package org.chromium.chromoting; |
| 6 | 6 |
| 7 import android.app.ActionBar; | 7 import android.app.ActionBar; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
| 10 import android.graphics.Canvas; | 10 import android.graphics.Canvas; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 * Redraws the canvas. This should be done on a non-UI thread or it could | 121 * Redraws the canvas. This should be done on a non-UI thread or it could |
| 122 * cause the UI to lag. Specifically, it is currently invoked on the native | 122 * cause the UI to lag. Specifically, it is currently invoked on the native |
| 123 * graphics thread using a JNI. | 123 * graphics thread using a JNI. |
| 124 */ | 124 */ |
| 125 @Override | 125 @Override |
| 126 public void run() { | 126 public void run() { |
| 127 if (Looper.myLooper() == Looper.getMainLooper()) { | 127 if (Looper.myLooper() == Looper.getMainLooper()) { |
| 128 Log.w("deskview", "Canvas being redrawn on UI thread"); | 128 Log.w("deskview", "Canvas being redrawn on UI thread"); |
| 129 } | 129 } |
| 130 | 130 |
| 131 Bitmap image = JniInterface.retrieveVideoFrame(); | 131 Bitmap image = JniInterface.getVideoFrame(); |
| 132 Canvas canvas = getHolder().lockCanvas(); | 132 Canvas canvas = getHolder().lockCanvas(); |
| 133 synchronized (mTransform) { | 133 synchronized (mTransform) { |
| 134 canvas.setMatrix(mTransform); | 134 canvas.setMatrix(mTransform); |
| 135 | 135 |
| 136 // Internal parameters of the transformation matrix. | 136 // Internal parameters of the transformation matrix. |
| 137 float[] values = new float[9]; | 137 float[] values = new float[9]; |
| 138 mTransform.getValues(values); | 138 mTransform.getValues(values); |
| 139 | 139 |
| 140 // Screen coordinates of two defining points of the image. | 140 // Screen coordinates of two defining points of the image. |
| 141 float[] topleft = {0, 0}; | 141 float[] topleft = {0, 0}; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 handleMouseMovement(x, y, mMouseButton, false); | 477 handleMouseMovement(x, y, mMouseButton, false); |
| 478 } | 478 } |
| 479 | 479 |
| 480 Log.i("mouse", "\tStarting right click"); | 480 Log.i("mouse", "\tStarting right click"); |
| 481 mMouseButton = BUTTON_RIGHT; | 481 mMouseButton = BUTTON_RIGHT; |
| 482 mMousePressed = true; | 482 mMousePressed = true; |
| 483 handleMouseMovement(x, y, mMouseButton, mMousePressed); | 483 handleMouseMovement(x, y, mMouseButton, mMousePressed); |
| 484 } | 484 } |
| 485 } | 485 } |
| 486 } | 486 } |
| OLD | NEW |