use of com.facebook.drawee.debug.DebugControllerOverlayDrawable in project fresco by facebook.
the class PipelineDraweeController method maybeUpdateDebugOverlay.
private void maybeUpdateDebugOverlay(@Nullable CloseableImage image) {
if (!mDrawDebugOverlay) {
return;
}
Drawable controllerOverlay = getControllerOverlay();
if (controllerOverlay == null) {
controllerOverlay = new DebugControllerOverlayDrawable();
setControllerOverlay(controllerOverlay);
}
if (controllerOverlay instanceof DebugControllerOverlayDrawable) {
DebugControllerOverlayDrawable debugOverlay = (DebugControllerOverlayDrawable) controllerOverlay;
debugOverlay.setControllerId(getId());
final DraweeHierarchy draweeHierarchy = getHierarchy();
ScaleType scaleType = null;
if (draweeHierarchy != null) {
final ScaleTypeDrawable scaleTypeDrawable = ScalingUtils.getActiveScaleTypeDrawable(draweeHierarchy.getTopLevelDrawable());
scaleType = scaleTypeDrawable != null ? scaleTypeDrawable.getScaleType() : null;
}
debugOverlay.setScaleType(scaleType);
if (image != null) {
debugOverlay.setDimensions(image.getWidth(), image.getHeight());
debugOverlay.setImageSize(image.getSizeInBytes());
} else {
debugOverlay.reset();
}
}
}
Aggregations