Skip to content

Commit

Permalink
Remove unused DRAW entry from ImageLoadStatus
Browse files Browse the repository at this point in the history
Reviewed By: oprisnik

Differential Revision: D58736743

fbshipit-source-id: 2b495a371bfb4fd2e977ee22dd71b69b0de601db
  • Loading branch information
steelrooter authored and facebook-github-bot committed Jun 19, 2024
1 parent 1a35431 commit f2a301f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ public void onRelease(String id) {

ImageLoadStatus lastImageLoadStatus = mImagePerfState.getImageLoadStatus();
if (lastImageLoadStatus != ImageLoadStatus.SUCCESS
&& lastImageLoadStatus != ImageLoadStatus.ERROR
&& lastImageLoadStatus != ImageLoadStatus.DRAW) {
&& lastImageLoadStatus != ImageLoadStatus.ERROR) {
mImagePerfState.setControllerId(id);
// The image request was canceled
}
Expand All @@ -105,9 +104,7 @@ public void onRelease(String id) {

@Override
public void onImageDrawn(String id, ImageInfo info, DimensionsInfo dimensionsInfo) {
mImagePerfState.setImageDrawTimeMs(mClock.now());
mImagePerfState.setDimensionsInfo(dimensionsInfo);
mImagePerfMonitor.notifyStatusUpdated(mImagePerfState, ImageLoadStatus.DRAW);
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ public void onImageDrawn(String id, ImageInfo info, DimensionsInfo dimensionsInf
ImagePerfState state = mImagePerfState;

state.setControllerId(id);
state.setImageDrawTimeMs(mClock.now());
state.setDimensionsInfo(dimensionsInfo);
updateStatus(state, ImageLoadStatus.DRAW);
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ enum class ImageLoadStatus(val value: Int) {
INTERMEDIATE_AVAILABLE(2),
SUCCESS(3),
ERROR(5),
DRAW(6),
EMPTY_EVENT(7),
RELEASED(8);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class ImagePerfData {
private final long mVisibilityEventTimeMs;
private final long mInvisibilityEventTimeMs;

private final long mImageDrawTimeMs;

private final @Nullable DimensionsInfo mDimensionsInfo;

private @Nullable Extras mExtraData;
Expand All @@ -67,7 +65,6 @@ public ImagePerfData(
VisibilityState visibilityState,
long visibilityEventTimeMs,
long invisibilityEventTime,
long imageDrawTimeMs,
@Nullable DimensionsInfo dimensionsInfo,
@Nullable Extras extraData) {
mControllerId = controllerId;
Expand All @@ -88,15 +85,10 @@ public ImagePerfData(
mVisibilityState = visibilityState;
mVisibilityEventTimeMs = visibilityEventTimeMs;
mInvisibilityEventTimeMs = invisibilityEventTime;
mImageDrawTimeMs = imageDrawTimeMs;
mDimensionsInfo = dimensionsInfo;
mExtraData = extraData;
}

public long getImageDrawTimeMs() {
return mImageDrawTimeMs;
}

@Nullable
public String getControllerId() {
return mControllerId;
Expand Down Expand Up @@ -219,7 +211,6 @@ public String createDebugString() {
.add("visibility state", mVisibilityState)
.add("visibility event", mVisibilityEventTimeMs)
.add("invisibility event", mInvisibilityEventTimeMs)
.add("image draw event", mImageDrawTimeMs)
.add("dimensions info", mDimensionsInfo)
.add("extra data", mExtraData)
.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class ImagePerfState {
private long mVisibilityEventTimeMs = UNSET;
private long mInvisibilityEventTimeMs = UNSET;
// Fetch efficiency
private long mImageDrawTimeMs = UNSET;
private @Nullable DimensionsInfo mDimensionsInfo;
// Pipeline and view extras
private @Nullable Extras mExtraData;
Expand Down Expand Up @@ -90,8 +89,6 @@ public void resetPointsTimestamps() {

mVisibilityEventTimeMs = UNSET;
mInvisibilityEventTimeMs = UNSET;

mImageDrawTimeMs = UNSET;
}

public void setImageLoadStatus(ImageLoadStatus imageLoadStatus) {
Expand Down Expand Up @@ -174,10 +171,6 @@ public void setVisible(boolean visible) {
mVisibilityState = visible ? VisibilityState.VISIBLE : VisibilityState.INVISIBLE;
}

public void setImageDrawTimeMs(long imageDrawTimeMs) {
mImageDrawTimeMs = imageDrawTimeMs;
}

public ImagePerfData snapshot() {
return new ImagePerfData(
mControllerId,
Expand All @@ -198,15 +191,10 @@ public ImagePerfData snapshot() {
mVisibilityState,
mVisibilityEventTimeMs,
mInvisibilityEventTimeMs,
mImageDrawTimeMs,
mDimensionsInfo,
mExtraData);
}

public long getImageDrawTimeMs() {
return mImageDrawTimeMs;
}

public void setDimensionsInfo(DimensionsInfo dimensionsInfo) {
mDimensionsInfo = dimensionsInfo;
}
Expand Down

0 comments on commit f2a301f

Please sign in to comment.