disable View.setDrawingCacheEnabled

This commit is contained in:
侯歌 2024-07-16 16:27:00 +08:00
parent f6fb2f3b5d
commit 1dd040c2b0
2 changed files with 7 additions and 4 deletions

View File

@ -56,7 +56,8 @@ AnimatedImageDrawable::AnimatedImageDrawable(cdroid::Context*ctx,const std::stri
AnimatedImageDrawable::~AnimatedImageDrawable(){
mStarting = false;
LOGD("%p",this);
auto frmSequence = mAnimatedImageState->mFrameSequence;
LOGD_IF(frmSequence,"%p/%p %dx%dx%d",this,frmSequence,frmSequence->getWidth(),frmSequence->getHeight(),frmSequence->getFrameCount());
if(mRunnable)
unscheduleSelf(mRunnable);
mRunnable = nullptr;
@ -300,8 +301,9 @@ Drawable*AnimatedImageDrawable::inflate(Context*ctx,const AttributeSet&atts){
if(ctx){
d = dynamic_cast<AnimatedImageDrawable*>(ctx->getDrawable(res));
LOGD_IF(d,"%s %p",res.c_str(),d);
}else{
d=new AnimatedImageDrawable(ctx,res);
}
if(d==nullptr){
d = new AnimatedImageDrawable(ctx,res);
const bool autoStart = atts.getBoolean("autoStart");
const int repeatCount= atts.getInt("repeatCount",REPEAT_UNDEFINED);
if(autoStart)d->start();

View File

@ -2524,7 +2524,8 @@ void View::setOnHoverListener(OnHoverListener l){
void View::setDrawingCacheEnabled(bool enabled) {
mCachingFailed = false;
setFlags(enabled ? DRAWING_CACHE_ENABLED : 0, DRAWING_CACHE_ENABLED);
//Do not uncoimment this Lines:
//setFlags(enabled ? DRAWING_CACHE_ENABLED : 0, DRAWING_CACHE_ENABLED);
}
bool View::isDrawingCacheEnabled()const{