Merge "Remove support for density compatibility in the hardware renderer."
This commit is contained in:
@ -84,14 +84,14 @@ public class SensorEvent {
|
||||
* sensor itself (<b>Fs</b>) using the relation:
|
||||
* </p>
|
||||
*
|
||||
* <b><center>Ad = - <EFBFBD>Fs / mass</center></b>
|
||||
* <b><center>Ad = - ∑Fs / mass</center></b>
|
||||
*
|
||||
* <p>
|
||||
* In particular, the force of gravity is always influencing the measured
|
||||
* acceleration:
|
||||
* </p>
|
||||
*
|
||||
* <b><center>Ad = -g - <EFBFBD>F / mass</center></b>
|
||||
* <b><center>Ad = -g - ∑F / mass</center></b>
|
||||
*
|
||||
* <p>
|
||||
* For this reason, when the device is sitting on a table (and obviously not
|
||||
|
@ -362,53 +362,48 @@ class GLES20Canvas extends Canvas {
|
||||
@Override
|
||||
public void drawPatch(Bitmap bitmap, byte[] chunks, RectF dst, Paint paint) {
|
||||
final int nativePaint = paint == null ? 0 : paint.mNativePaint;
|
||||
nDrawPatch(mRenderer, bitmap.mNativeBitmap, chunks, dst.left, dst.top, dst.right,
|
||||
dst.bottom, nativePaint, bitmap.getDensity(), mDensity, mScreenDensity);
|
||||
nDrawPatch(mRenderer, bitmap.mNativeBitmap, chunks, dst.left, dst.top,
|
||||
dst.right, dst.bottom, nativePaint);
|
||||
}
|
||||
|
||||
private native void nDrawPatch(int renderer, int bitmap, byte[] chunks, float left, float top,
|
||||
float right, float bottom, int paint, int bitmapDensity, int canvasDensity, int screenDensity);
|
||||
float right, float bottom, int paint);
|
||||
|
||||
@Override
|
||||
public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) {
|
||||
final int nativePaint = paint == null ? 0 : paint.mNativePaint;
|
||||
nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, nativePaint,
|
||||
bitmap.getDensity(), mDensity, mScreenDensity);
|
||||
nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, nativePaint);
|
||||
}
|
||||
|
||||
private native void nDrawBitmap(int renderer, int bitmap, float left, float top, int paint);
|
||||
|
||||
@Override
|
||||
public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) {
|
||||
final int nativePaint = paint == null ? 0 : paint.mNativePaint;
|
||||
nDrawBitmap(mRenderer, bitmap.mNativeBitmap, matrix.native_instance, nativePaint,
|
||||
bitmap.getDensity(), mDensity, mScreenDensity);
|
||||
nDrawBitmap(mRenderer, bitmap.mNativeBitmap, matrix.native_instance, nativePaint);
|
||||
}
|
||||
|
||||
private native void nDrawBitmap(int renderer, int bitmap, int matrix, int paint,
|
||||
int bitmapDensity, int canvasDensity, int screenDensity);
|
||||
private native void nDrawBitmap(int renderer, int bitmap, int matrix, int paint);
|
||||
|
||||
@Override
|
||||
public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) {
|
||||
final int nativePaint = paint == null ? 0 : paint.mNativePaint;
|
||||
nDrawBitmap(mRenderer, bitmap.mNativeBitmap, src.left, src.top, src.right, src.bottom,
|
||||
dst.left, dst.top, dst.right, dst.bottom, nativePaint,
|
||||
bitmap.getDensity(), mDensity, mScreenDensity);
|
||||
dst.left, dst.top, dst.right, dst.bottom, nativePaint
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint) {
|
||||
final int nativePaint = paint == null ? 0 : paint.mNativePaint;
|
||||
nDrawBitmap(mRenderer, bitmap.mNativeBitmap, src.left, src.top, src.right, src.bottom,
|
||||
dst.left, dst.top, dst.right, dst.bottom, nativePaint,
|
||||
bitmap.getDensity(), mDensity, mScreenDensity);
|
||||
dst.left, dst.top, dst.right, dst.bottom, nativePaint
|
||||
);
|
||||
}
|
||||
|
||||
private native void nDrawBitmap(int renderer, int bitmap, float left, float top, int paint,
|
||||
int bitmapDensity, int canvasDensity, int screenDensity);
|
||||
|
||||
private native void nDrawBitmap(int renderer, int bitmap,
|
||||
float srcLeft, float srcTop, float srcRight, float srcBottom,
|
||||
float left, float top, float right, float bottom, int paint,
|
||||
int bitmapDensity, int canvasDensity, int screenDensity);
|
||||
float left, float top, float right, float bottom, int paint);
|
||||
|
||||
@Override
|
||||
public void drawBitmap(int[] colors, int offset, int stride, float x, float y,
|
||||
|
@ -17,10 +17,8 @@
|
||||
|
||||
package android.view;
|
||||
|
||||
import android.content.res.CompatibilityInfo;
|
||||
import android.graphics.Canvas;
|
||||
import android.os.SystemClock;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
@ -74,14 +72,8 @@ abstract class HardwareRenderer {
|
||||
*
|
||||
* @param view The view to draw.
|
||||
* @param attachInfo AttachInfo tied to the specified view.
|
||||
* @param translator Translator used to draw applications in compatibility mode.
|
||||
* @param yoff The vertical offset for the drawing.
|
||||
* @param density The density of the application
|
||||
* @param scalingRequired Whether drawing should be scaled.
|
||||
*/
|
||||
abstract void draw(View view, View.AttachInfo attachInfo,
|
||||
CompatibilityInfo.Translator translator, int yoff, int density,
|
||||
boolean scalingRequired);
|
||||
abstract void draw(View view, View.AttachInfo attachInfo, int yOffset);
|
||||
|
||||
/**
|
||||
* Initializes the hardware renderer for the specified surface and setup the
|
||||
@ -371,9 +363,7 @@ abstract class HardwareRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
void draw(View view, View.AttachInfo attachInfo, CompatibilityInfo.Translator translator,
|
||||
int yoff, int density, boolean scalingRequired) {
|
||||
|
||||
void draw(View view, View.AttachInfo attachInfo, int yOffset) {
|
||||
if (canDraw()) {
|
||||
attachInfo.mDrawingTime = SystemClock.uptimeMillis();
|
||||
attachInfo.mIgnoreDirtyState = true;
|
||||
@ -383,14 +373,9 @@ abstract class HardwareRenderer {
|
||||
|
||||
Canvas canvas = mCanvas;
|
||||
int saveCount = canvas.save(Canvas.MATRIX_SAVE_FLAG);
|
||||
canvas.translate(0, -yOffset);
|
||||
|
||||
try {
|
||||
canvas.translate(0, -yoff);
|
||||
if (translator != null) {
|
||||
translator.translateCanvas(canvas);
|
||||
}
|
||||
canvas.setDensity(density);
|
||||
canvas.setScreenDensity(scalingRequired ? DisplayMetrics.DENSITY_DEVICE : 0);
|
||||
|
||||
view.draw(canvas);
|
||||
} finally {
|
||||
canvas.restoreToCount(saveCount);
|
||||
|
@ -1262,7 +1262,7 @@ public final class ViewRoot extends Handler implements ViewParent, View.AttachIn
|
||||
|
||||
if (mHwRenderer != null && mHwRenderer.isEnabled()) {
|
||||
if (!dirty.isEmpty()) {
|
||||
mHwRenderer.draw(mView, mAttachInfo, mTranslator, yoff, mDensity, scalingRequired);
|
||||
mHwRenderer.draw(mView, mAttachInfo, yoff);
|
||||
}
|
||||
|
||||
if (scrolling) {
|
||||
|
Reference in New Issue
Block a user