Skip to content

Commit

Permalink
Merge pull request MoSync#127 from divineprog/ThreeZeroOne
Browse files Browse the repository at this point in the history
[MOSYNC-2053] Android: Reverted performance fix that did not work properly
  • Loading branch information
Ali Sarrafi committed Mar 30, 2012
2 parents b0bff4e + e5b18ff commit 7c94cce
Showing 1 changed file with 20 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1788,33 +1788,22 @@ void _maGetImageData(
imageResource.mBitmap.getWidth() );
}

if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.DONUT)
{
// In 1.6 and below we use the version that includes the bug fix.
_maGetImageDataAlphaBugFix(
image,
imageResource,
dst,
srcLeft,
srcTop,
srcWidth,
srcHeight,
scanLength);
}
else
{
// Above 1.6 we can use the faster version. This is about 2-5 times
// faster depending on the device/platform.
_maGetImageDataFast(
image,
imageResource,
dst,
srcLeft,
srcTop,
srcWidth,
srcHeight,
scanLength);
}
// TODO: removed the "fast" version because of a bug, visual output
// looks bad, run TestApp to test, fix this in 3.1. We use the "slow"
// version for now. Try approach to see if .hasAlpha() can be used.

// if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.DONUT)

// In 1.6 and below we use the version that includes the bug fix.
_maGetImageDataAlphaBugFix(
image,
imageResource,
dst,
srcLeft,
srcTop,
srcWidth,
srcHeight,
scanLength);

/*
* For what it is worth, this might be interesting to investigate,
Expand All @@ -1826,6 +1815,9 @@ void _maGetImageData(
}

/**
* TODO: Not used, results look bad on tansparent pixels,
* test to enable in 3.1. Call from maGetImageData.
*
* Plain way of getting the image pixel data.
*
* @param image
Expand All @@ -1837,6 +1829,7 @@ void _maGetImageData(
* @param srcHeight
* @param scanLength
*/
@SuppressWarnings("unused")
private void _maGetImageDataFast(
int image,
ImageCache imageResource,
Expand Down

0 comments on commit 7c94cce

Please sign in to comment.