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

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: 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 | no next file » | 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 Preconditions.isNull(mDesktop); 91 Preconditions.isNull(mDesktop);
92 Preconditions.isNull(mClient); 92 Preconditions.isNull(mClient);
93 Preconditions.notNull(desktop); 93 Preconditions.notNull(desktop);
94 Preconditions.notNull(client); 94 Preconditions.notNull(client);
95 mDesktop = desktop; 95 mDesktop = desktop;
96 mClient = client; 96 mClient = client;
97 mInputHandler.init(desktop, new InputEventSender(client)); 97 mInputHandler.init(desktop, new InputEventSender(client));
98 } 98 }
99 99
100 public Event<PaintEventParameter> onPaint() { 100 public Event<PaintEventParameter> onPaint() {
101 return mOnPaint; 101 return mOnPaint;
Lambros 2016/06/28 17:53:44 Why is this publicly exposed, if you're only using
Lambros 2016/06/28 18:09:20 This should be documented in DesktopViewInterface,
Hzj_jie 2016/06/28 18:57:49 Done.
Hzj_jie 2016/06/28 18:57:49 I will add comments in this simple fix. But yes, t
102 } 102 }
103 103
104 public Event<SizeChangedEventParameter> onClientSizeChanged() { 104 public Event<SizeChangedEventParameter> onClientSizeChanged() {
105 return mOnClientSizeChanged; 105 return mOnClientSizeChanged;
106 } 106 }
107 107
108 public Event<SizeChangedEventParameter> onHostSizeChanged() { 108 public Event<SizeChangedEventParameter> onHostSizeChanged() {
109 return mOnHostSizeChanged; 109 return mOnHostSizeChanged;
110 } 110 }
111 111
(...skipping 82 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() {
205 if (mInputAnimationRunning) { 205 @Override
Lambros 2016/06/27 23:16:16 I don't understand why removing the mInputAnimatio
Hzj_jie 2016/06/27 23:45:45 FeedbackAnimator adds itself as SelfRemovableParam
Yuwei 2016/06/28 04:26:51 If I understand it right, the bug is: * When call
Yuwei 2016/06/28 08:43:40 I think if you use mOnPaint for TouchInputHandler
Hzj_jie 2016/06/28 18:57:49 Yes, that's the plan. This root cause of this bug
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();
224 } else if (!mOnPaint.isEmpty()) { 220 } else if (!mOnPaint.isEmpty()) {
Lambros 2016/06/27 23:16:16 I don't understand this logic. Why would we trigge
Hzj_jie 2016/06/27 23:45:45 Same as above, the only difference is we will rend
Yuwei 2016/06/28 04:26:51 Could we do something like: if (mInputHandler.pro
Hzj_jie 2016/06/28 18:57:49 Yes, we will remove mAnimationLock and mInputAnima
225 requestRepaint(); 221 requestRepaint();
226 } 222 }
227 } 223 }
228 224
229 /** 225 /**
230 * Called after the canvas is initially created, then after every subsequent resize, as when 226 * Called after the canvas is initially created, then after every subsequent resize, as when
231 * the display is rotated. 227 * the display is rotated.
232 */ 228 */
233 @Override 229 @Override
234 public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { 230 public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 public void transformationChanged() { 316 public void transformationChanged() {
321 requestRepaint(); 317 requestRepaint();
322 } 318 }
323 319
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;
Sergey Ulanov 2016/06/28 00:13:33 Should this be set before requestRepaint() is call
Hzj_jie 2016/06/28 00:22:32 Yes, requestRepaint just schedules a task in nativ
Yuwei 2016/06/28 00:28:09 I think it is safe to remove the lock. After mInpu
Hzj_jie 2016/06/28 18:57:49 No matter, I will remove the mix of callback patte
331 } 327 }
332 } 328 }
333 } 329 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698