Merge "Prevent crash in VPN settings Bug #5217245"
This commit is contained in:
@@ -413,8 +413,8 @@ public abstract class HardwareRenderer {
|
|||||||
if (error != EGL_SUCCESS) {
|
if (error != EGL_SUCCESS) {
|
||||||
// something bad has happened revert to
|
// something bad has happened revert to
|
||||||
// normal rendering.
|
// normal rendering.
|
||||||
fallback(error != EGL11.EGL_CONTEXT_LOST);
|
|
||||||
Log.w(LOG_TAG, "EGL error: " + GLUtils.getEGLErrorString(error));
|
Log.w(LOG_TAG, "EGL error: " + GLUtils.getEGLErrorString(error));
|
||||||
|
fallback(error != EGL11.EGL_CONTEXT_LOST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -702,8 +702,9 @@ public abstract class HardwareRenderer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void setup(int width, int height) {
|
void setup(int width, int height) {
|
||||||
checkCurrent();
|
if (validate()) {
|
||||||
mCanvas.setViewport(width, height);
|
mCanvas.setViewport(width, height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canDraw() {
|
boolean canDraw() {
|
||||||
|
|||||||
@@ -1352,7 +1352,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mAttachInfo.mHardwareRenderer != null &&
|
mAttachInfo.mHardwareRenderer != null &&
|
||||||
mAttachInfo.mHardwareRenderer.isEnabled())) {
|
mAttachInfo.mHardwareRenderer.isEnabled())) {
|
||||||
mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight);
|
mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight);
|
||||||
if (!hwInitialized) {
|
if (!hwInitialized && mAttachInfo.mHardwareRenderer.isEnabled()) {
|
||||||
mAttachInfo.mHardwareRenderer.invalidate(mHolder);
|
mAttachInfo.mHardwareRenderer.invalidate(mHolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user