Merge "Make nested hardware layers work again" into honeycomb
This commit is contained in:
@@ -8087,7 +8087,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
*
|
||||
* @return A HardwareLayer ready to render, or null if an error occurred.
|
||||
*/
|
||||
HardwareLayer getHardwareLayer(Canvas currentCanvas) {
|
||||
HardwareLayer getHardwareLayer() {
|
||||
if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -8107,7 +8107,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
mHardwareLayer.resize(width, height);
|
||||
}
|
||||
|
||||
final HardwareCanvas canvas = mHardwareLayer.start(mAttachInfo.mHardwareCanvas);
|
||||
Canvas currentCanvas = mAttachInfo.mHardwareCanvas;
|
||||
final HardwareCanvas canvas = mHardwareLayer.start(currentCanvas);
|
||||
mAttachInfo.mHardwareCanvas = canvas;
|
||||
try {
|
||||
canvas.setViewport(width, height);
|
||||
// TODO: We should pass the dirty rect
|
||||
@@ -8131,7 +8133,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
canvas.restoreToCount(restoreCount);
|
||||
} finally {
|
||||
canvas.onPostDraw();
|
||||
mHardwareLayer.end(mAttachInfo.mHardwareCanvas);
|
||||
mHardwareLayer.end(currentCanvas);
|
||||
mAttachInfo.mHardwareCanvas = currentCanvas;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2475,7 +2475,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
if (hasNoCache) {
|
||||
boolean layerRendered = false;
|
||||
if (layerType == LAYER_TYPE_HARDWARE) {
|
||||
final HardwareLayer layer = child.getHardwareLayer(canvas);
|
||||
final HardwareLayer layer = child.getHardwareLayer();
|
||||
if (layer != null && layer.isValid()) {
|
||||
((HardwareCanvas) canvas).drawHardwareLayer(layer, 0, 0, child.mLayerPaint);
|
||||
layerRendered = true;
|
||||
|
||||
Reference in New Issue
Block a user