use of com.facebook.drawee.interfaces.DraweeHierarchy in project fresco by facebook.
the class PipelineDraweeController method updateDebugOverlay.
/**
* updateDebugOverlay updates the debug overlay. Subclasses of {@link PipelineDraweeController}
* can override this method (and call <code>super</code>) to provide additional debug information.
*/
protected void updateDebugOverlay(@Nullable CloseableImage image, DebugControllerOverlayDrawable debugOverlay) {
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);
// fill in image origin text and color hint
final int origin = mDebugOverlayImageOriginListener.getImageOrigin();
final String originText = ImageOriginUtils.toString(origin);
final int originColor = DebugOverlayImageOriginColor.getImageOriginColor(origin);
debugOverlay.setOrigin(originText, originColor);
if (image != null) {
debugOverlay.setDimensions(image.getWidth(), image.getHeight());
debugOverlay.setImageSize(image.getSizeInBytes());
} else {
debugOverlay.reset();
}
}
use of com.facebook.drawee.interfaces.DraweeHierarchy in project fresco by facebook.
the class ImagePerfMonitor method addViewportData.
public void addViewportData() {
DraweeHierarchy hierarchy = mPipelineDraweeController.getHierarchy();
if (hierarchy != null && hierarchy.getTopLevelDrawable() != null) {
Rect bounds = hierarchy.getTopLevelDrawable().getBounds();
mImagePerfState.setOnScreenWidth(bounds.width());
mImagePerfState.setOnScreenHeight(bounds.height());
}
}
Aggregations