Merge "Prevent crash in VPN settings Bug #5217245"

This commit is contained in:
Romain Guy
2011-08-26 13:37:35 -07:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -413,8 +413,8 @@ public abstract class HardwareRenderer {
if (error != EGL_SUCCESS) {
// something bad has happened revert to
// normal rendering.
fallback(error != EGL11.EGL_CONTEXT_LOST);
Log.w(LOG_TAG, "EGL error: " + GLUtils.getEGLErrorString(error));
fallback(error != EGL11.EGL_CONTEXT_LOST);
}
}
}
@@ -702,8 +702,9 @@ public abstract class HardwareRenderer {
@Override
void setup(int width, int height) {
checkCurrent();
mCanvas.setViewport(width, height);
if (validate()) {
mCanvas.setViewport(width, height);
}
}
boolean canDraw() {

View File

@@ -1352,7 +1352,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
mAttachInfo.mHardwareRenderer != null &&
mAttachInfo.mHardwareRenderer.isEnabled())) {
mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight);
if (!hwInitialized) {
if (!hwInitialized && mAttachInfo.mHardwareRenderer.isEnabled()) {
mAttachInfo.mHardwareRenderer.invalidate(mHolder);
}
}