summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-08-31 11:50:35 -0700
committerRomain Guy <romainguy@google.com>2010-08-31 11:50:35 -0700
commitda8532c6f48b4c10b5e2ccb9e08690341efa1616 (patch)
treee6ce7f533b4f4bb5bb9cdf60be64138d6bbb34ea /graphics
parent7dff1a72146ba549d51649ad786a0e1cc8b6897c (diff)
downloadframeworks_base-da8532c6f48b4c10b5e2ccb9e08690341efa1616.zip
frameworks_base-da8532c6f48b4c10b5e2ccb9e08690341efa1616.tar.gz
frameworks_base-da8532c6f48b4c10b5e2ccb9e08690341efa1616.tar.bz2
Add hooks for hardware accelerated WebView.
Change-Id: I907cdec8a67594f87749ac46bda85f04af5a2003
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/Canvas.java47
1 files changed, 46 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 36a8e57..e75a19e 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1551,7 +1551,52 @@ public class Canvas {
drawPicture(picture);
restore();
}
-
+
+ /**
+ * <p>Acquires the Canvas context. After invoking this method, the Canvas
+ * context can be modified by the caller. For instance, if you acquire
+ * the context of an OpenGL Canvas you can reset the GL viewport, scissor,
+ * etc.</p>
+ *
+ * <p>A call to {@link #acquireContext()} should aways be followed by
+ * a call to {@link #releaseContext()}, preferrably using a try block:</p>
+ *
+ * <pre>
+ * try {
+ * if (canvas.acquireContext()) {
+ * // Use the canvas and/or its context
+ * }
+ * } finally {
+ * canvas.releaseContext();
+ * }
+ * </pre>
+ *
+ * <p>Acquiring the context can be an expensive operation and should not
+ * be done unless absolutely necessary.</p>
+ *
+ * <p>Applications should never invoke this method directly.</p>
+ *
+ * @return True if the context could be acquired successfully, false
+ * otherwise (if the context is already acquired for instance.)
+ *
+ * @see #releaseContext()
+ *
+ * @hide
+ */
+ public boolean acquireContext() {
+ return false;
+ }
+
+ /**
+ * <p>Release the context acquired with {@link #acquireContext()}.</p>
+ *
+ * @see #acquireContext()
+ *
+ * @hide
+ */
+ public void releaseContext() {
+ }
+
@Override
protected void finalize() throws Throwable {
try {