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

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

Issue 2101783002: [Chromoting] Feedback animation has stopped (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments to explain onPaint behavior. 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
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/DesktopViewInterface.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; 5 package org.chromium.chromoting;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.Bitmap; 8 import android.graphics.Bitmap;
9 import android.graphics.Canvas; 9 import android.graphics.Canvas;
10 import android.graphics.Color; 10 import android.graphics.Color;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 Bitmap cursorBitmap = mClient.getDisplay().getCursorBitmap(); 194 Bitmap cursorBitmap = mClient.getDisplay().getCursorBitmap();
195 if (cursorBitmap != null) { 195 if (cursorBitmap != null) {
196 Point hotspot = mClient.getDisplay().getCursorHotspot(); 196 Point hotspot = mClient.getDisplay().getCursorHotspot();
197 canvas.drawBitmap(cursorBitmap, cursorPosition.x - hotspot.x, 197 canvas.drawBitmap(cursorBitmap, cursorPosition.x - hotspot.x,
198 cursorPosition.y - hotspot.y, new Paint()); 198 cursorPosition.y - hotspot.y, new Paint());
199 } 199 }
200 } 200 }
201 201
202 getHolder().unlockCanvasAndPost(canvas); 202 getHolder().unlockCanvasAndPost(canvas);
203 203
204 synchronized (mAnimationLock) { 204 getHandler().postAtTime(new Runnable() {
Yuwei 2016/06/29 01:17:43 I'm not sure whether this is a good solution if it
Hzj_jie 2016/06/29 01:38:11 Done.
205 if (mInputAnimationRunning) { 205 @Override
206 getHandler().postAtTime(new Runnable() { 206 public void run() {
207 @Override 207 processAnimation();
208 public void run() {
209 processAnimation();
210 }
211 }, startTimeMs + 30);
212 } 208 }
213 } 209 }, startTimeMs + 30);
214 } 210 }
215 211
216 private void processAnimation() { 212 private void processAnimation() {
217 boolean running; 213 boolean running;
218 synchronized (mAnimationLock) { 214 synchronized (mAnimationLock) {
219 running = mInputAnimationRunning; 215 running = mInputAnimationRunning;
220 } 216 }
221 if (running) { 217 if (running) {
222 mInputHandler.processAnimation(); 218 mInputHandler.processAnimation();
223 requestRepaint(); 219 requestRepaint();
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 @Override 320 @Override
325 public void setAnimationEnabled(boolean enabled) { 321 public void setAnimationEnabled(boolean enabled) {
326 synchronized (mAnimationLock) { 322 synchronized (mAnimationLock) {
327 if (enabled && !mInputAnimationRunning) { 323 if (enabled && !mInputAnimationRunning) {
328 requestRepaint(); 324 requestRepaint();
329 } 325 }
330 mInputAnimationRunning = enabled; 326 mInputAnimationRunning = enabled;
331 } 327 }
332 } 328 }
333 } 329 }
OLDNEW
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/DesktopViewInterface.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698