diff options
author | Tom Hudson <tomhudson@google.com> | 2014-12-09 15:03:44 -0500 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-01-05 15:25:41 -0800 |
commit | 8dfaa4904205772cdceee63ef3989bcdedf1a914 (patch) | |
tree | baf5ea37427770659698766562bbd3b80f9eddf9 /graphics | |
parent | c82be5f27f1dd9da665b0ca52590cc30ede4e78a (diff) | |
download | frameworks_base-8dfaa4904205772cdceee63ef3989bcdedf1a914.zip frameworks_base-8dfaa4904205772cdceee63ef3989bcdedf1a914.tar.gz frameworks_base-8dfaa4904205772cdceee63ef3989bcdedf1a914.tar.bz2 |
Make DisplayListRenderer inherit from Canvas, merge JNI
Incrementally unify the upper layers for Skia and HWUI.
Remove redundant code from GLES20Canvas.java; instead
use inherited mNativeCanvasWrapper and superclass method
definitions.
Moves some unrelated SkPaint utility functions from Renderer
to new utils/PaintUtils.
bug: 15672762
Change-Id: I4ddd4214b8e9eeb95289d054ef423f2542bb5fa5
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index a0267c8..2a7e177 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -44,8 +44,12 @@ import javax.microedition.khronos.opengles.GL; */ public class Canvas { - // assigned in constructors or setBitmap, freed in finalizer - private long mNativeCanvasWrapper; + /** + * Should only be assigned in constructors (or setBitmap if software canvas), + * freed in finalizer. + * @hide + */ + protected long mNativeCanvasWrapper; /** @hide */ public long getNativeCanvasWrapper() { @@ -1619,6 +1623,9 @@ public class Canvas { int colorOffset, @Nullable short[] indices, int indexOffset, int indexCount, @NonNull Paint paint) { checkRange(verts.length, vertOffset, vertexCount); + if (isHardwareAccelerated()) { + return; + } if (texs != null) { checkRange(texs.length, texOffset, vertexCount); } |