make viewcount debuginfo print only changed

This commit is contained in:
houzh 2023-11-27 19:34:10 +08:00
parent f4731ac943
commit 8e1f54754a
5 changed files with 8 additions and 5 deletions

View File

@ -444,8 +444,6 @@ ColorStateList* Assets::getColorStateList(const std::string&fullresid) {
name = AttributeSet::normalize(pkg,name);
auto itc= mColors.find(name);
auto its = mStateColors.find(name);
if(fullresid.compare("#313431")==0)
LOGI("");
if( its!=mStateColors.end())
return its->second;
else if(itc != mColors.end()){

View File

@ -266,6 +266,10 @@ void GraphDevice::composeSurfaces(){
}/*endif for wSurfaces.size*/
GFXFlip(mPrimarySurface);
mLastComposeTime = SystemClock::uptimeMillis();
if( (View::mViewCount!=mLastViewCount) && View::VIEW_DEBUG){
LOGD("Total ViewCount %d",View::mViewCount);
mLastViewCount = View::mViewCount;
}
mPendingCompose = 0;
}
}//end namespace

View File

@ -18,6 +18,7 @@ private:
int mFormat;
int mComposing;
int mPendingCompose;
int mLastViewCount;
bool mQuitFlag;
bool mShowFPS;
uint64_t mLastComposeTime;

View File

@ -441,7 +441,7 @@ View::View(Context*ctx,const AttributeSet&attrs){
void View::initView(){
mViewCount ++;
LOGD_IF(View::VIEW_DEBUG,"mViewCount=%d",mViewCount);
LOGV_IF(View::VIEW_DEBUG,"mViewCount=%d",mViewCount);
mID = NO_ID;
mAutofillViewId =NO_ID;
mAccessibilityViewId = NO_ID;
@ -519,7 +519,7 @@ void View::initView(){
View::~View(){
mViewCount --;
LOGD_IF(View::VIEW_DEBUG,"mViewCount=%d",mViewCount);
LOGV_IF(View::VIEW_DEBUG,"mViewCount=%d",mViewCount);
if(mParent)
mParent->removeViewInternal(this);
if(isAttachedToWindow())onDetachedFromWindow();

View File

@ -47,6 +47,7 @@ typedef std::string Parcelable;
class View:public Drawable::Callback,public KeyEvent::Callback{
public:
static bool VIEW_DEBUG;
static int mViewCount;
constexpr static int DEBUG_CORNERS_COLOR = 0xFF3f7fff;
constexpr static int DEBUG_CORNERS_SIZE_DIP = 8;
constexpr static int NO_ID =-1;
@ -371,7 +372,6 @@ public:
private:
friend ViewGroup;
friend ViewPropertyAnimator;
static int mViewCount;
int mMinWidth;
int mMinHeight;
int mDrawingCacheBackgroundColor;