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

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

Issue 2484743003: Fix screen flicker when resizing CRD window in split-screen mode (Closed)
Patch Set: Fixing some comments before the review. Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.graphics.Matrix; 7 import android.graphics.Matrix;
8 import android.graphics.PointF; 8 import android.graphics.PointF;
9 import android.graphics.Rect; 9 import android.graphics.Rect;
10 import android.graphics.RectF; 10 import android.graphics.RectF;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (parameter.softInputMethodVisible) { 115 if (parameter.softInputMethodVisible) {
116 mSystemUiScreenRect.set( 116 mSystemUiScreenRect.set(
117 parameter.left, parameter.top, parameter.right, parameter.bo ttom); 117 parameter.left, parameter.top, parameter.right, parameter.bo ttom);
118 118
119 stopOffsetReductionAnimation(); 119 stopOffsetReductionAnimation();
120 } else { 120 } else {
121 mSystemUiScreenRect.setEmpty(); 121 mSystemUiScreenRect.setEmpty();
122 startOffsetReductionAnimation(); 122 startOffsetReductionAnimation();
123 } 123 }
124 124
125 repositionImage(); 125 if (mRenderData.initialized()) {
126 // The viewport center may have changed so update the position to re flect the new value.
127 repositionImage();
128 }
126 } 129 }
127 130
128 public void adjustViewportForSystemUi(boolean adjustViewportForSystemUi) { 131 public void adjustViewportForSystemUi(boolean adjustViewportForSystemUi) {
129 mAdjustViewportSizeForSystemUi = adjustViewportForSystemUi; 132 mAdjustViewportSizeForSystemUi = adjustViewportForSystemUi;
130 133
131 // The viewport center may have changed so reposition the image to refle ct the new value. 134 if (mRenderData.initialized()) {
132 repositionImage(); 135 // The viewport center may have changed so update the position to re flect the new value.
136 repositionImage();
137 }
133 } 138 }
134 139
135 /** Resizes the image by zooming it such that the image is displayed without borders. */ 140 /** Resizes the image by zooming it such that the image is displayed without borders. */
136 public void resizeImageToFitScreen() { 141 public void resizeImageToFitScreen() {
137 // Protect against being called before the image has been initialized. 142 // Protect against being called before the image has been initialized.
138 if (mRenderData.imageWidth == 0 || mRenderData.imageHeight == 0) { 143 if (mRenderData.imageWidth == 0 || mRenderData.imageHeight == 0) {
139 return; 144 return;
140 } 145 }
141 146
142 float widthRatio = (float) mRenderData.screenWidth / mRenderData.imageWi dth; 147 float widthRatio = (float) mRenderData.screenWidth / mRenderData.imageWi dth;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 446 }
442 447
443 /** 448 /**
444 * Stops an existing offset reduction animation. 449 * Stops an existing offset reduction animation.
445 */ 450 */
446 private void stopOffsetReductionAnimation() { 451 private void stopOffsetReductionAnimation() {
447 // Setting this value this null will prevent it from continuing to execu te. 452 // Setting this value this null will prevent it from continuing to execu te.
448 mFrameRenderedCallback = null; 453 mFrameRenderedCallback = null;
449 } 454 }
450 } 455 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698