summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-20 13:32:16 -0800
committerGlenn Kasten <gkasten@google.com>2012-02-22 13:19:26 -0800
commit685c9ce3bd5782f52f2ca52d944ccd26933e79f2 (patch)
tree942c1dd968fd0aa34dbc2d793c2c27b72ace8944 /graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
parenta352d1e2418f2f43d0e0a82f73799027e304fd96 (diff)
Avoid wp<>::unsafe_get() with a few exceptions
Avoid using wp<>::unsafe_get() except in a log, and other specific cases when it's known to be safe. Use more specific subclass types for parameters to avoid down-casts. When a constructor or method parameter is "this" of an object that is currently being constructed, it's better to use a raw pointer rather than either sp<> or wp<>. Using the raw pointer is safe, provided either: - it is "this" of an object being constructed (which has sp<> refcount of 0), - or the caller already holds an sp<> The raw pointer is simpler and faster, and it avoids the problem of the sp<> reference count being incremented and then decremented to zero on scope exit, which would cause the object's destructor to run while the object is still being constructed. Also removed some dead code per a review comment. Change-Id: I7375f64da3aec11b928c33cb01faff186252ef5e
Diffstat (limited to 'graphics/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions