summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-06-09 18:21:37 -0700
committerRomain Guy <romainguy@google.com>2010-06-09 18:27:08 -0700
commit2d6145993e19d2bb664766dbaf3c1e9ad3d12cdc (patch)
treea4d7a5bacb0b6c423a89e9a520185109117ffcff /graphics/java/android
parent1d46191d88ee9262ea05b868d2db5b44ad85fa43 (diff)
downloadframeworks_base-2d6145993e19d2bb664766dbaf3c1e9ad3d12cdc.zip
frameworks_base-2d6145993e19d2bb664766dbaf3c1e9ad3d12cdc.tar.gz
frameworks_base-2d6145993e19d2bb664766dbaf3c1e9ad3d12cdc.tar.bz2
Move OpenGL support out of ViewRoot into a new HardwareRenderer class.
Change-Id: Iffaed924a5defc3c4df26223c390dc27eee115b1
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/Canvas.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index aec977a..e2634d1 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -117,16 +117,33 @@ public class Canvas {
*
* <p>The initial target density of the canvas is the same as the initial
* density of bitmaps as per {@link Bitmap#getDensity() Bitmap.getDensity()}.
+ *
+ * @deprecated This constructor is not supported and should not be invoked.
*/
public Canvas(GL gl) {
mNativeCanvas = initGL();
mGL = gl;
mDensity = Bitmap.getDefaultDensity();
}
+
+ /**
+ * Indicates whether this Canvas uses hardware acceleration.
+ *
+ * Note that this method does not define what type of hardware acceleration
+ * may or may not be used.
+ *
+ * @return True if drawing operations are hardware accelerated,
+ * false otherwise.
+ */
+ public boolean isHardwareAccelerated() {
+ return mGL != null;
+ }
/**
* Return the GL object associated with this canvas, or null if it is not
* backed by GL.
+ *
+ * @deprecated This method is not supported and should not be invoked.
*/
public GL getGL() {
return mGL;
@@ -136,6 +153,8 @@ public class Canvas {
* Call this to free up OpenGL resources that may be cached or allocated
* on behalf of the Canvas. Any subsequent drawing with a GL-backed Canvas
* will have to recreate those resources.
+ *
+ * @deprecated This method is not supported and should not be invoked.
*/
public static void freeGlCaches() {
freeCaches();
@@ -168,8 +187,10 @@ public class Canvas {
* Set the viewport dimensions if this canvas is GL based. If it is not,
* this method is ignored and no exception is thrown.
*
- * @param width The width of the viewport
- * @param height The height of the viewport
+ * @param width The width of the viewport
+ * @param height The height of the viewport
+ *
+ * @deprecated This method is not supported and should not be invoked.
*/
public void setViewport(int width, int height) {
if (mGL != null) {
@@ -1339,8 +1360,8 @@ public class Canvas {
* position (start + length) can be used for shaping context.
* @param x the x position at which to draw the text
* @param y the y position at which to draw the text
- * @param dir the run direction, either {@link DIRECTION_LTR} or
- * {@link DIRECTION_RTL}.
+ * @param dir the run direction, either {@link #DIRECTION_LTR} or
+ * {@link #DIRECTION_RTL}.
* @param paint the paint
* @hide
*/