Bug 1341275: Rm redundant check for size change in onSizeChanged. r=sebastian draft
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 14 Jul 2017 14:52:34 -0700
changeset 609849 1a53346d35102f1925941d3723c369f6b276ec5a
parent 609848 c5ac9ae6ac8d413fa9cfa26c0506cfd31abd4bc6
child 609850 7a6f5bee52c39d72410ab7976ddcc53c96b17179
push id68705
push usermichael.l.comella@gmail.com
push dateMon, 17 Jul 2017 15:48:39 +0000
reviewerssebastian
bugs1341275
milestone56.0a1
Bug 1341275: Rm redundant check for size change in onSizeChanged. r=sebastian onSizeChanged should only be called when the size actually changes. However, I did notice weird behavior in the debugger where `formatImage` appeared to be called twice from onSizeChanged, however, I was unable to reproduce this behavior with log statements. MozReview-Commit-ID: A5amGqTxv55
mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
--- a/mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
@@ -96,21 +96,16 @@ public class FaviconView extends ImageVi
         mBackgroundRect = new RectF(0, 0, 0, 0);
         mResources = getResources();
     }
 
     @Override
     protected void onSizeChanged(int w, int h, int oldw, int oldh) {
         super.onSizeChanged(w, h, oldw, oldh);
 
-        // No point rechecking the image if there hasn't really been any change.
-        if (w == oldw && h == oldh) {
-            return;
-        }
-
         mBackgroundRect.right = w;
         mBackgroundRect.bottom = h;
 
         formatImage();
     }
 
     @Override
     public void onDraw(Canvas canvas) {