Permalink
Browse files

Clear render bitmaps before re-drawing

We weren't clearing the bitmaps used to render the translucent and
masked content which would cause text to look aliased over time.
  • Loading branch information...
1 parent 358fd8f commit db4cd1a0056711f9b4b2442267c7fff139a8abe3 @jasleensingh jasleensingh committed Apr 21, 2015
Showing with 2 additions and 0 deletions.
  1. +2 −0 shimmer-android/src/main/java/com/facebook/shimmer/ShimmerFrameLayout.java
@@ -763,6 +763,7 @@ private Bitmap tryCreateRenderBitmap() {
// Draws the children without any mask.
private void drawUnmasked(Canvas renderCanvas) {
+ renderCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
super.dispatchDraw(renderCanvas);
}
@@ -778,6 +779,7 @@ private void drawMasked(Canvas renderCanvas) {
mMaskOffsetY,
mMaskOffsetX + maskBitmap.getWidth(),
mMaskOffsetY + maskBitmap.getHeight());
+ renderCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
super.dispatchDraw(renderCanvas);
renderCanvas.drawBitmap(maskBitmap, mMaskOffsetX, mMaskOffsetY, mMaskPaint);

0 comments on commit db4cd1a

Please sign in to comment.