summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSangkyu Lee <sk82.lee@lge.com>2014-11-21 18:05:41 +0900
committerSangkyu Lee <sk82.lee@lge.com>2014-11-26 09:59:39 +0900
commitf76d36f96bf221672e98e440c9df7cbf0e02e84e (patch)
treee1c81a2faf4ea012f087292f198b703fc9d0288c
parentf926d71b8ef2790da067550144860705c1a61fe5 (diff)
downloadframeworks_base-f76d36f96bf221672e98e440c9df7cbf0e02e84e.zip
frameworks_base-f76d36f96bf221672e98e440c9df7cbf0e02e84e.tar.gz
frameworks_base-f76d36f96bf221672e98e440c9df7cbf0e02e84e.tar.bz2
Prevent calling GL functions with an invalid surface
When destroying CanvasContext, the surface can be invalid state. So the surface should be updated to null prior to destroying GL resources to ensure that GL functions are not called with an invalid surface. Some GL implementation makes an error if GL functions are called with an invalid surface. (Adreno 3xx) Change-Id: Ie6f6ea081ec931fc9df30b2c3ed066ec1ae9d294
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index b50a433..92a30e5 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -59,6 +59,7 @@ CanvasContext::~CanvasContext() {
void CanvasContext::destroy() {
stopDrawing();
+ setSurface(NULL);
freePrefetechedLayers();
destroyHardwareResources();
mAnimationContext->destroy();
@@ -66,7 +67,6 @@ void CanvasContext::destroy() {
delete mCanvas;
mCanvas = 0;
}
- setSurface(NULL);
}
void CanvasContext::setSurface(ANativeWindow* window) {