From f663182d524c7fb7e02ab8a99b6cc79de7cc952d Mon Sep 17 00:00:00 2001
From: Leon Scroggins III <scroggo@google.com>
Date: Wed, 22 Jul 2020 12:40:06 -0400
Subject: [PATCH] =?UTF-8?q?Update=20graphics=20language=20to=20comply=20wi?=
 =?UTF-8?q?th=20Android=E2=80=99s=20inclusive=20language=20guidance?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Bug: 161896447
Test: make

See https://source.android.com/setup/contribute/respectful-code for reference

Change-Id: I57b81fb5fd2177fbf96f9cc900097f7da1955fca
---
 core/tests/coretests/src/android/graphics/PathTest.java | 4 +++-
 graphics/java/android/graphics/Region.java              | 4 ++--
 libs/hwui/hwui/Bitmap.cpp                               | 7 ++-----
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/core/tests/coretests/src/android/graphics/PathTest.java b/core/tests/coretests/src/android/graphics/PathTest.java
index c6d6d1ff90d5..b50792ca6b38 100644
--- a/core/tests/coretests/src/android/graphics/PathTest.java
+++ b/core/tests/coretests/src/android/graphics/PathTest.java
@@ -28,7 +28,9 @@ public class PathTest extends TestCase {
 
         final Path.FillType defaultFillType = path.getFillType();
         final Path.FillType fillType = Path.FillType.INVERSE_EVEN_ODD;
-        assertFalse(fillType.equals(defaultFillType));  // Sanity check for the test itself.
+
+        // This test is only meaningful if it changes from the default.
+        assertFalse(fillType.equals(defaultFillType));
 
         path.setFillType(fillType);
         path.reset();
diff --git a/graphics/java/android/graphics/Region.java b/graphics/java/android/graphics/Region.java
index d8d96413a93d..43373ffbd3f4 100644
--- a/graphics/java/android/graphics/Region.java
+++ b/graphics/java/android/graphics/Region.java
@@ -409,10 +409,10 @@ public class Region implements Parcelable {
         mNativeRegion = ni;
     }
 
-    /* add dummy parameter so constructor can be called from jni without
+    /* Add an unused parameter so constructor can be called from jni without
        triggering 'not cloneable' exception */
     @UnsupportedAppUsage
-    private Region(long ni, int dummy) {
+    private Region(long ni, int unused) {
         this(ni);
     }
 
diff --git a/libs/hwui/hwui/Bitmap.cpp b/libs/hwui/hwui/Bitmap.cpp
index c21bdca3db77..7352061bd2cd 100644
--- a/libs/hwui/hwui/Bitmap.cpp
+++ b/libs/hwui/hwui/Bitmap.cpp
@@ -182,11 +182,8 @@ static SkImageInfo validateAlpha(const SkImageInfo& info) {
 void Bitmap::reconfigure(const SkImageInfo& newInfo, size_t rowBytes) {
     mInfo = validateAlpha(newInfo);
 
-    // Dirty hack is dirty
-    // TODO: Figure something out here, Skia's current design makes this
-    // really hard to work with. Skia really, really wants immutable objects,
-    // but with the nested-ref-count hackery going on that's just not
-    // feasible without going insane trying to figure it out
+    // TODO: Skia intends for SkPixelRef to be immutable, but this method
+    // modifies it. Find another way to support reusing the same pixel memory.
     this->android_only_reset(mInfo.width(), mInfo.height(), rowBytes);
 }
 
-- 
GitLab