Special case for SDK 8 and using direct rendering

This commit is contained in:
Victor Shcherb 2012-04-28 15:43:04 +02:00
parent 456d032b7c
commit 762171bab2
2 changed files with 6 additions and 2 deletions

View file

@ -68,6 +68,10 @@ public class NativeOsmandLibrary {
}
return isSupported();
}
public boolean useDirectRendering(){
return android.os.Build.VERSION.SDK_INT >= 8;
}
public RenderingGenerationResult generateRendering(RenderingContext rc, NativeSearchResult searchResultHandler,
Bitmap bitmap, int requestedBitmapWidth, int requestedBitmapHeight, int rowBytes, boolean isTransparent,

View file

@ -210,7 +210,7 @@ public class OsmandRenderer {
rc.sinRotateTileSize = FloatMath.sin((float) Math.toRadians(rc.rotate)) * TILE_SIZE;
rc.density = dm.density;
try {
if(Looper.getMainLooper() != null){
if(Looper.getMainLooper() != null && library.useDirectRendering()) {
final Handler h = new Handler(Looper.getMainLooper());
notifyListenersWithDelay(rc, notifyList, h);
}
@ -335,7 +335,7 @@ public class OsmandRenderer {
notifyListenersWithDelay(rc, notifyList, h);
}
}
}, 700);
}, 800);
}
private void drawIconsOverCanvas(RenderingContext rc, Canvas cv) {