Loading graphics/java/android/graphics/Canvas.java +18 −19 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ public class Canvas { protected int mScreenDensity = Bitmap.DENSITY_NONE; // Used by native code @SuppressWarnings("UnusedDeclaration") private int mSurfaceFormat; /** Loading Loading @@ -1079,8 +1080,6 @@ public class Canvas { /** * Draws the specified bitmap as an N-patch (most often, a 9-patches.) * * Note: Only supported by hardware accelerated canvas at the moment. * * @param patch The ninepatch object to render * @param dst The destination rectangle. * @param paint The paint to draw the bitmap with. may be null Loading @@ -1088,13 +1087,12 @@ public class Canvas { * @hide */ public void drawPatch(NinePatch patch, Rect dst, Paint paint) { patch.drawSoftware(this, dst, paint); } /** * Draws the specified bitmap as an N-patch (most often, a 9-patches.) * * Note: Only supported by hardware accelerated canvas at the moment. * * @param patch The ninepatch object to render * @param dst The destination rectangle. * @param paint The paint to draw the bitmap with. may be null Loading @@ -1102,6 +1100,7 @@ public class Canvas { * @hide */ public void drawPatch(NinePatch patch, RectF dst, Paint paint) { patch.drawSoftware(this, dst, paint); } /** Loading graphics/java/android/graphics/NinePatch.java +20 −24 Original line number Diff line number Diff line Loading @@ -100,14 +100,7 @@ public class NinePatch { * @param location Where to draw the bitmap. */ public void draw(Canvas canvas, RectF location) { if (canvas.isHardwareAccelerated()) { canvas.drawPatch(this, location, mPaint); } else { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, mPaint != null ? mPaint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } } /** Loading @@ -117,14 +110,7 @@ public class NinePatch { * @param location Where to draw the bitmap. */ public void draw(Canvas canvas, Rect location) { if (canvas.isHardwareAccelerated()) { canvas.drawPatch(this, location, mPaint); } else { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, mPaint != null ? mPaint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } } /** Loading @@ -135,13 +121,23 @@ public class NinePatch { * @param paint The Paint to draw through. */ public void draw(Canvas canvas, Rect location, Paint paint) { if (canvas.isHardwareAccelerated()) { canvas.drawPatch(this, location, paint); } else { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } /** * @hide */ void drawSoftware(Canvas canvas, RectF location, Paint paint) { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } /** * @hide */ void drawSoftware(Canvas canvas, Rect location, Paint paint) { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } /** Loading libs/hwui/Patch.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,8 @@ TextureVertex* Patch::createMesh(const float bitmapWidth, const float bitmapHeig uint32_t maxVertices = ((xCount + 1) * (yCount + 1) - emptyQuads) * 4; if (maxVertices == 0) return NULL; vertices = new TextureVertex[maxVertices]; TextureVertex* vertex = vertices; TextureVertex* tempVertices = new TextureVertex[maxVertices]; TextureVertex* vertex = tempVertices; const int32_t* xDivs = patch->xDivs; const int32_t* yDivs = patch->yDivs; Loading Loading @@ -159,6 +159,14 @@ TextureVertex* Patch::createMesh(const float bitmapWidth, const float bitmapHeig width, bitmapWidth, quadCount); } if (verticesCount == maxVertices) { vertices = tempVertices; } else { vertices = new TextureVertex[verticesCount]; memcpy(vertices, tempVertices, verticesCount * sizeof(TextureVertex)); delete[] tempVertices; } return vertices; } Loading Loading
graphics/java/android/graphics/Canvas.java +18 −19 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ public class Canvas { protected int mScreenDensity = Bitmap.DENSITY_NONE; // Used by native code @SuppressWarnings("UnusedDeclaration") private int mSurfaceFormat; /** Loading Loading @@ -1079,8 +1080,6 @@ public class Canvas { /** * Draws the specified bitmap as an N-patch (most often, a 9-patches.) * * Note: Only supported by hardware accelerated canvas at the moment. * * @param patch The ninepatch object to render * @param dst The destination rectangle. * @param paint The paint to draw the bitmap with. may be null Loading @@ -1088,13 +1087,12 @@ public class Canvas { * @hide */ public void drawPatch(NinePatch patch, Rect dst, Paint paint) { patch.drawSoftware(this, dst, paint); } /** * Draws the specified bitmap as an N-patch (most often, a 9-patches.) * * Note: Only supported by hardware accelerated canvas at the moment. * * @param patch The ninepatch object to render * @param dst The destination rectangle. * @param paint The paint to draw the bitmap with. may be null Loading @@ -1102,6 +1100,7 @@ public class Canvas { * @hide */ public void drawPatch(NinePatch patch, RectF dst, Paint paint) { patch.drawSoftware(this, dst, paint); } /** Loading
graphics/java/android/graphics/NinePatch.java +20 −24 Original line number Diff line number Diff line Loading @@ -100,14 +100,7 @@ public class NinePatch { * @param location Where to draw the bitmap. */ public void draw(Canvas canvas, RectF location) { if (canvas.isHardwareAccelerated()) { canvas.drawPatch(this, location, mPaint); } else { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, mPaint != null ? mPaint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } } /** Loading @@ -117,14 +110,7 @@ public class NinePatch { * @param location Where to draw the bitmap. */ public void draw(Canvas canvas, Rect location) { if (canvas.isHardwareAccelerated()) { canvas.drawPatch(this, location, mPaint); } else { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, mPaint != null ? mPaint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } } /** Loading @@ -135,13 +121,23 @@ public class NinePatch { * @param paint The Paint to draw through. */ public void draw(Canvas canvas, Rect location, Paint paint) { if (canvas.isHardwareAccelerated()) { canvas.drawPatch(this, location, paint); } else { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } /** * @hide */ void drawSoftware(Canvas canvas, RectF location, Paint paint) { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } /** * @hide */ void drawSoftware(Canvas canvas, Rect location, Paint paint) { nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } /** Loading
libs/hwui/Patch.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,8 @@ TextureVertex* Patch::createMesh(const float bitmapWidth, const float bitmapHeig uint32_t maxVertices = ((xCount + 1) * (yCount + 1) - emptyQuads) * 4; if (maxVertices == 0) return NULL; vertices = new TextureVertex[maxVertices]; TextureVertex* vertex = vertices; TextureVertex* tempVertices = new TextureVertex[maxVertices]; TextureVertex* vertex = tempVertices; const int32_t* xDivs = patch->xDivs; const int32_t* yDivs = patch->yDivs; Loading Loading @@ -159,6 +159,14 @@ TextureVertex* Patch::createMesh(const float bitmapWidth, const float bitmapHeig width, bitmapWidth, quadCount); } if (verticesCount == maxVertices) { vertices = tempVertices; } else { vertices = new TextureVertex[verticesCount]; memcpy(vertices, tempVertices, verticesCount * sizeof(TextureVertex)); delete[] tempVertices; } return vertices; } Loading