Merge "Destroy drawing cache when switching layer type" into nyc-dev

This commit is contained in:
Chris Craik
2016-04-14 17:07:33 +00:00
committed by Android (Google) Code Review

View File

@@ -15742,8 +15742,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return;
}
// Destroy any previous software drawing cache if needed
if (mLayerType == LAYER_TYPE_SOFTWARE) {
if (layerType != LAYER_TYPE_SOFTWARE) {
// Destroy any previous software drawing cache if present
// NOTE: even if previous layer type is HW, we do this to ensure we've cleaned up
// drawing cache created in View#draw when drawing to a SW canvas.
destroyDrawingCache();
}