Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沉迷打码的小凳子
glide
提交
48754e61
G
glide
项目概览
沉迷打码的小凳子
/
glide
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glide
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
48754e61
编写于
8月 25, 2017
作者:
S
Sam Judd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix lint/pmd/findbugs errors.
上级
d836ac20
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
12 deletion
+23
-12
library/src/main/java/com/bumptech/glide/load/DecodeFormat.java
...y/src/main/java/com/bumptech/glide/load/DecodeFormat.java
+1
-1
library/src/main/java/com/bumptech/glide/load/engine/DecodeJob.java
...c/main/java/com/bumptech/glide/load/engine/DecodeJob.java
+3
-1
library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/LruBitmapPool.java
...ptech/glide/load/engine/bitmap_recycle/LruBitmapPool.java
+15
-8
library/src/main/java/com/bumptech/glide/load/resource/bitmap/Downsampler.java
.../com/bumptech/glide/load/resource/bitmap/Downsampler.java
+2
-2
library/src/main/java/com/bumptech/glide/load/resource/bitmap/HardwareConfigState.java
...ptech/glide/load/resource/bitmap/HardwareConfigState.java
+2
-0
未找到文件。
library/src/main/java/com/bumptech/glide/load/DecodeFormat.java
浏览文件 @
48754e61
...
...
@@ -27,7 +27,7 @@ public enum DecodeFormat {
/**
* Identical to {@link #PREFER_ARGB_8888} but prevents Glide from using {@link
* android.graphics.Bitmap.Config#HARDWARE} on Android O+
* android.graphics.Bitmap.Config#HARDWARE} on Android O+
.
*
* @deprecated If you must disable hardware bitmaps, set
* {@link com.bumptech.glide.load.resource.bitmap.Downsampler#ALLOW_HARDWARE_CONFIG} to false
...
...
library/src/main/java/com/bumptech/glide/load/engine/DecodeJob.java
浏览文件 @
48754e61
...
...
@@ -478,7 +478,9 @@ class DecodeJob<R> implements DataFetcherGenerator.FetcherReadyCallback,
Options
options
=
getOptionsWithHardwareConfig
(
dataSource
);
DataRewinder
<
Data
>
rewinder
=
glideContext
.
getRegistry
().
getRewinder
(
data
);
try
{
return
path
.
load
(
rewinder
,
options
,
width
,
height
,
new
DecodeCallback
<>(
dataSource
));
// ResourceType in DecodeCallback below is required for compilation to work with gradle.
return
path
.
load
(
rewinder
,
options
,
width
,
height
,
new
DecodeCallback
<
ResourceType
>(
dataSource
));
}
finally
{
rewinder
.
cleanup
();
}
...
...
library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/LruBitmapPool.java
浏览文件 @
48754e61
...
...
@@ -142,16 +142,23 @@ public class LruBitmapPool implements BitmapPool {
return
result
;
}
@
Nullable
private
s
ynchronized
Bitmap
getDirtyOrNull
(
int
width
,
int
height
,
Bitmap
.
Config
config
)
{
@
TargetApi
(
Build
.
VERSION_CODES
.
O
)
private
s
tatic
void
assertNotHardwareConfig
(
Bitmap
.
Config
config
)
{
// Avoid short circuiting on sdk int since it breaks on some versions of Android.
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
if
(
config
==
Bitmap
.
Config
.
HARDWARE
)
{
throw
new
IllegalArgumentException
(
"Cannot create a mutable Bitmap with config: "
+
config
+
". Consider setting Downsampler#ALLOW_HARDWARE_CONFIG to false in your RequestOptions"
+
" and/or in GlideBuilder.setDefaultRequestOptions"
);
}
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
O
)
{
return
;
}
if
(
config
==
Bitmap
.
Config
.
HARDWARE
)
{
throw
new
IllegalArgumentException
(
"Cannot create a mutable Bitmap with config: "
+
config
+
". Consider setting Downsampler#ALLOW_HARDWARE_CONFIG to false in your RequestOptions"
+
" and/or in GlideBuilder.setDefaultRequestOptions"
);
}
}
@Nullable
private
synchronized
Bitmap
getDirtyOrNull
(
int
width
,
int
height
,
Bitmap
.
Config
config
)
{
assertNotHardwareConfig
(
config
);
// Config will be null for non public config types, which can lead to transformations naively
// passing in null as the requested config here. See issue #194.
final
Bitmap
result
=
strategy
.
get
(
width
,
height
,
config
!=
null
?
config
:
DEFAULT_CONFIG
);
...
...
library/src/main/java/com/bumptech/glide/load/resource/bitmap/Downsampler.java
浏览文件 @
48754e61
...
...
@@ -194,8 +194,8 @@ public final class Downsampler {
DecodeFormat
decodeFormat
=
options
.
get
(
DECODE_FORMAT
);
DownsampleStrategy
downsampleStrategy
=
options
.
get
(
DOWNSAMPLE_STRATEGY
);
boolean
fixBitmapToRequestedDimensions
=
options
.
get
(
FIX_BITMAP_SIZE_TO_REQUESTED_DIMENSIONS
);
boolean
isHardwareConfigAllowed
=
options
.
get
(
ALLOW_HARDWARE_CONFIG
)
!=
null
?
options
.
get
(
ALLOW_HARDWARE_CONFIG
)
:
false
;
boolean
isHardwareConfigAllowed
=
options
.
get
(
ALLOW_HARDWARE_CONFIG
)
!=
null
&&
options
.
get
(
ALLOW_HARDWARE_CONFIG
)
;
if
(
decodeFormat
==
DecodeFormat
.
PREFER_ARGB_8888_DISALLOW_HARDWARE
)
{
isHardwareConfigAllowed
=
false
;
}
...
...
library/src/main/java/com/bumptech/glide/load/resource/bitmap/HardwareConfigState.java
浏览文件 @
48754e61
package
com.bumptech.glide.load.resource.bitmap
;
import
android.annotation.TargetApi
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.os.Build
;
...
...
@@ -70,6 +71,7 @@ final class HardwareConfigState {
// Singleton constructor.
}
@TargetApi
(
Build
.
VERSION_CODES
.
O
)
boolean
setHardwareConfigIfAllowed
(
int
targetWidth
,
int
targetHeight
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录