summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2011-11-15 14:21:58 -0800
committerAlex Sakhartchouk <alexst@google.com>2011-11-15 14:21:58 -0800
commit38da5086a65e8065e85bbca3638da752dba1dbe7 (patch)
treea3c4117a10cea23458dcfcce1cdf603efb9dc25c /graphics
parent3aa684ec0d3f70027fa808fb95b096a1613a1ddc (diff)
downloadframeworks_base-38da5086a65e8065e85bbca3638da752dba1dbe7.zip
frameworks_base-38da5086a65e8065e85bbca3638da752dba1dbe7.tar.gz
frameworks_base-38da5086a65e8065e85bbca3638da752dba1dbe7.tar.bz2
Followup to a bug fix.
Addtion of synchronized to the methods triggers an API change. Per council advice, pushing synch block into the function body. Change-Id: Iaa395d9720bce499259ab750fe97149715e9f271
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/renderscript/RSSurfaceView.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/graphics/java/android/renderscript/RSSurfaceView.java b/graphics/java/android/renderscript/RSSurfaceView.java
index 20eb93f..a8e3107 100644
--- a/graphics/java/android/renderscript/RSSurfaceView.java
+++ b/graphics/java/android/renderscript/RSSurfaceView.java
@@ -77,10 +77,12 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public synchronized void surfaceDestroyed(SurfaceHolder holder) {
- // Surface will be destroyed when we return
- if (mRS != null) {
- mRS.setSurface(null, 0, 0);
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ synchronized (this) {
+ // Surface will be destroyed when we return
+ if (mRS != null) {
+ mRS.setSurface(null, 0, 0);
+ }
}
}
@@ -88,9 +90,11 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public synchronized void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
- if (mRS != null) {
- mRS.setSurface(holder, w, h);
+ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ synchronized (this) {
+ if (mRS != null) {
+ mRS.setSurface(holder, w, h);
+ }
}
}
@@ -125,9 +129,11 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
return rs;
}
- public synchronized void destroyRenderScriptGL() {
- mRS.destroy();
- mRS = null;
+ public void destroyRenderScriptGL() {
+ synchronized (this) {
+ mRS.destroy();
+ mRS = null;
+ }
}
public void setRenderScriptGL(RenderScriptGL rs) {