am 1bdb3be9: Merge "Fix RenderScript copy tracing sections"

* commit '1bdb3be9cc284733f8c385b449b46221416c4018':
  Fix RenderScript copy tracing sections
This commit is contained in:
Chris Craik
2015-06-04 17:13:46 +00:00
committed by Android Git Automerger

View File

@@ -1053,6 +1053,7 @@ public class Allocation extends BaseObj {
mSelectedLOD, mSelectedFace.mID, mSelectedLOD, mSelectedFace.mID,
count, 1, data.getID(mRS), dataOff, 0, count, 1, data.getID(mRS), dataOff, 0,
data.mSelectedLOD, data.mSelectedFace.mID); data.mSelectedLOD, data.mSelectedFace.mID);
Trace.traceEnd(RenderScript.TRACE_TAG);
} }
private void validate2DRange(int xoff, int yoff, int w, int h) { private void validate2DRange(int xoff, int yoff, int w, int h) {
@@ -1214,6 +1215,7 @@ public class Allocation extends BaseObj {
* @param data the Bitmap to be copied * @param data the Bitmap to be copied
*/ */
public void copy2DRangeFrom(int xoff, int yoff, Bitmap data) { public void copy2DRangeFrom(int xoff, int yoff, Bitmap data) {
try {
Trace.traceBegin(RenderScript.TRACE_TAG, "copy2DRangeFrom"); Trace.traceBegin(RenderScript.TRACE_TAG, "copy2DRangeFrom");
mRS.validate(); mRS.validate();
if (data.getConfig() == null) { if (data.getConfig() == null) {
@@ -1226,8 +1228,10 @@ public class Allocation extends BaseObj {
validateBitmapFormat(data); validateBitmapFormat(data);
validate2DRange(xoff, yoff, data.getWidth(), data.getHeight()); validate2DRange(xoff, yoff, data.getWidth(), data.getHeight());
mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, data); mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, data);
} finally {
Trace.traceEnd(RenderScript.TRACE_TAG); Trace.traceEnd(RenderScript.TRACE_TAG);
} }
}
private void validate3DRange(int xoff, int yoff, int zoff, int w, int h, int d) { private void validate3DRange(int xoff, int yoff, int zoff, int w, int h, int d) {
if (mAdaptedAllocation != null) { if (mAdaptedAllocation != null) {