2020-11-12 02:11:44 +00:00
|
|
|
.class public final Landroidx/core/graphics/PaintCompat;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "PaintCompat.java"
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2020-11-16 01:00:50 +00:00
|
|
|
.field public static final EM_STRING:Ljava/lang/String; = "m"
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
.field public static final TOFU_STRING:Ljava/lang/String; = "\udb3f\udffd"
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
.field public static final sRectThreadLocal:Ljava/lang/ThreadLocal;
|
2020-11-12 02:11:44 +00:00
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/lang/ThreadLocal<",
|
|
|
|
"Landroidx/core/util/Pair<",
|
|
|
|
"Landroid/graphics/Rect;",
|
|
|
|
"Landroid/graphics/Rect;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/ThreadLocal;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/ThreadLocal;-><init>()V
|
|
|
|
|
|
|
|
sput-object v0, Landroidx/core/graphics/PaintCompat;->sRectThreadLocal:Ljava/lang/ThreadLocal;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
.method public constructor <init>()V
|
2020-11-12 02:11:44 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static hasGlyph(Landroid/graphics/Paint;Ljava/lang/String;)Z
|
|
|
|
.locals 9
|
|
|
|
.param p0 # Landroid/graphics/Paint;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p1 # Ljava/lang/String;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
|
|
|
|
const/16 v1, 0x17
|
|
|
|
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroid/graphics/Paint;->hasGlyph(Ljava/lang/String;)Z
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
return p0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
if-ne v0, v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1, v2}, Ljava/lang/String;->charAt(I)C
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v3}, Ljava/lang/Character;->isWhitespace(C)Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
|
|
|
|
return v1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string/jumbo v3, "\udb3f\udffd"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v3}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
const-string v5, "m"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v5}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
cmpl-float v8, v6, v7
|
|
|
|
|
|
|
|
if-nez v8, :cond_2
|
|
|
|
|
|
|
|
return v2
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
|
|
|
|
move-result v8
|
|
|
|
|
|
|
|
invoke-virtual {p1, v2, v8}, Ljava/lang/String;->codePointCount(II)I
|
|
|
|
|
|
|
|
move-result v8
|
|
|
|
|
|
|
|
if-le v8, v1, :cond_5
|
|
|
|
|
|
|
|
const/high16 v8, 0x40000000 # 2.0f
|
|
|
|
|
|
|
|
mul-float v5, v5, v8
|
|
|
|
|
|
|
|
cmpl-float v5, v6, v5
|
|
|
|
|
|
|
|
if-lez v5, :cond_3
|
|
|
|
|
|
|
|
return v2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v5, v0, :cond_4
|
|
|
|
|
|
|
|
invoke-virtual {p1, v5}, Ljava/lang/String;->codePointAt(I)I
|
|
|
|
|
|
|
|
move-result v8
|
|
|
|
|
|
|
|
invoke-static {v8}, Ljava/lang/Character;->charCount(I)I
|
|
|
|
|
|
|
|
move-result v8
|
|
|
|
|
|
|
|
add-int/2addr v8, v5
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1, v5, v8}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;II)F
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
add-float/2addr v7, v5
|
|
|
|
|
|
|
|
move v5, v8
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
cmpl-float v5, v6, v7
|
|
|
|
|
|
|
|
if-ltz v5, :cond_5
|
|
|
|
|
|
|
|
return v2
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
cmpl-float v4, v6, v4
|
|
|
|
|
|
|
|
if-eqz v4, :cond_6
|
|
|
|
|
|
|
|
return v1
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
invoke-static {}, Landroidx/core/graphics/PaintCompat;->obtainEmptyRects()Landroidx/core/util/Pair;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
const/4 v5, 0x2
|
|
|
|
|
|
|
|
iget-object v6, v4, Landroidx/core/util/Pair;->first:Ljava/lang/Object;
|
|
|
|
|
|
|
|
check-cast v6, Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
invoke-virtual {p0, v3, v2, v5, v6}, Landroid/graphics/Paint;->getTextBounds(Ljava/lang/String;IILandroid/graphics/Rect;)V
|
|
|
|
|
|
|
|
iget-object v3, v4, Landroidx/core/util/Pair;->second:Ljava/lang/Object;
|
|
|
|
|
|
|
|
check-cast v3, Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1, v2, v0, v3}, Landroid/graphics/Paint;->getTextBounds(Ljava/lang/String;IILandroid/graphics/Rect;)V
|
|
|
|
|
|
|
|
iget-object p0, v4, Landroidx/core/util/Pair;->first:Ljava/lang/Object;
|
|
|
|
|
|
|
|
check-cast p0, Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
iget-object p1, v4, Landroidx/core/util/Pair;->second:Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroid/graphics/Rect;->equals(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
xor-int/2addr p0, v1
|
|
|
|
|
|
|
|
return p0
|
|
|
|
.end method
|
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
.method public static obtainEmptyRects()Landroidx/core/util/Pair;
|
|
|
|
.locals 3
|
2020-11-12 02:11:44 +00:00
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Landroidx/core/util/Pair<",
|
|
|
|
"Landroid/graphics/Rect;",
|
|
|
|
"Landroid/graphics/Rect;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
sget-object v0, Landroidx/core/graphics/PaintCompat;->sRectThreadLocal:Ljava/lang/ThreadLocal;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;
|
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Landroidx/core/util/Pair;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
if-nez v0, :cond_0
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
new-instance v0, Landroidx/core/util/Pair;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
new-instance v1, Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Landroid/graphics/Rect;-><init>()V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
new-instance v2, Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
invoke-direct {v2}, Landroid/graphics/Rect;-><init>()V
|
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
invoke-direct {v0, v1, v2}, Landroidx/core/util/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
sget-object v1, Landroidx/core/graphics/PaintCompat;->sRectThreadLocal:Ljava/lang/ThreadLocal;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-11-16 01:00:50 +00:00
|
|
|
iget-object v1, v0, Landroidx/core/util/Pair;->first:Ljava/lang/Object;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
check-cast v1, Landroid/graphics/Rect;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
invoke-virtual {v1}, Landroid/graphics/Rect;->setEmpty()V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
iget-object v1, v0, Landroidx/core/util/Pair;->second:Ljava/lang/Object;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
check-cast v1, Landroid/graphics/Rect;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
invoke-virtual {v1}, Landroid/graphics/Rect;->setEmpty()V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
:goto_0
|
2020-11-16 01:00:50 +00:00
|
|
|
return-object v0
|
2020-11-12 02:11:44 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static setBlendMode(Landroid/graphics/Paint;Landroidx/core/graphics/BlendModeCompat;)Z
|
|
|
|
.locals 4
|
|
|
|
.param p0 # Landroid/graphics/Paint;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p1 # Landroidx/core/graphics/BlendModeCompat;
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/16 v3, 0x1d
|
|
|
|
|
|
|
|
if-lt v0, v3, :cond_1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/core/graphics/BlendModeUtils;->obtainBlendModeFromCompat(Landroidx/core/graphics/BlendModeCompat;)Landroid/graphics/BlendMode;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0, v2}, Landroid/graphics/Paint;->setBlendMode(Landroid/graphics/BlendMode;)V
|
|
|
|
|
|
|
|
return v1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/core/graphics/BlendModeUtils;->obtainPorterDuffFromCompat(Landroidx/core/graphics/BlendModeCompat;)Landroid/graphics/PorterDuff$Mode;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
|
|
|
new-instance v2, Landroid/graphics/PorterDuffXfermode;
|
|
|
|
|
|
|
|
invoke-direct {v2, p1}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-virtual {p0, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;
|
|
|
|
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return v1
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
invoke-virtual {p0, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;
|
|
|
|
|
|
|
|
return v1
|
|
|
|
.end method
|