summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/CanvasTexture.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-03-22 11:13:11 -0700
committerJohn Reck <jreck@google.com>2012-03-22 11:28:29 -0700
commit8ebcb114b8559032e8dc3a05ccb8abfb36bd609b (patch)
tree1e82d16604bd17f7941f92afdfa580bc5114a504 /Source/WebCore/platform/graphics/android/CanvasTexture.cpp
parent6aea92fd5ffd5a43b1c13769be9a16202f498b59 (diff)
downloadexternal_webkit-8ebcb114b8559032e8dc3a05ccb8abfb36bd609b.zip
external_webkit-8ebcb114b8559032e8dc3a05ccb8abfb36bd609b.tar.gz
external_webkit-8ebcb114b8559032e8dc3a05ccb8abfb36bd609b.tar.bz2
Null out m_canvas if HTMLCanvasElement is destroyed
Bug: 6209508 Change-Id: I99be936cde28047d516ecdfcc20cd099241569ca
Diffstat (limited to 'Source/WebCore/platform/graphics/android/CanvasTexture.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/CanvasTexture.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/WebCore/platform/graphics/android/CanvasTexture.cpp b/Source/WebCore/platform/graphics/android/CanvasTexture.cpp
index 90a4798..ca520fd 100644
--- a/Source/WebCore/platform/graphics/android/CanvasTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/CanvasTexture.cpp
@@ -64,6 +64,18 @@ PassRefPtr<CanvasTexture> CanvasTexture::getCanvasTexture(CanvasLayer* layer)
return adoptRef(new CanvasTexture(layer->uniqueId()));
}
+bool CanvasTexture::setHwAccelerated(bool hwAccelerated)
+{
+ android::Mutex::Autolock lock(m_surfaceLock);
+ if (m_useHwAcceleration == hwAccelerated)
+ return false;
+ m_useHwAcceleration = hwAccelerated;
+ if (!m_ANW.get())
+ return false;
+ destroySurfaceTexture();
+ return true;
+}
+
/********************************************
* Called by WebKit thread
********************************************/
@@ -159,7 +171,7 @@ bool CanvasTexture::updateTexImage()
}
/********************************************
- * Called by UI thread (with or without GL context)
+ * Called by both threads
********************************************/
void CanvasTexture::destroySurfaceTexture()
@@ -171,18 +183,6 @@ void CanvasTexture::destroySurfaceTexture()
}
}
-bool CanvasTexture::setHwAccelerated(bool hwAccelerated)
-{
- android::Mutex::Autolock lock(m_surfaceLock);
- if (m_useHwAcceleration == hwAccelerated)
- return false;
- m_useHwAcceleration = hwAccelerated;
- if (!m_ANW.get())
- return false;
- destroySurfaceTexture();
- return true;
-}
-
/********************************************
* Called by WebKit thread
********************************************/