summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2013-07-25 11:39:02 +0530
committerAmit Pundir <amit.pundir@linaro.org>2013-07-25 11:39:02 +0530
commitacd950f8afadf5d8136f0b27c9d65dba6abce2d0 (patch)
tree8939941d3c5ff9fdd7ac3d02a5acf9f85c3b8480
parent76c57bd4de2629435f7e450ed9ed6e0bb403df85 (diff)
downloadbase-acd950f8afadf5d8136f0b27c9d65dba6abce2d0.tar.gz
frameworks/base:(Hack)Print the content displayed with Canvas.drawText
This hack allows us to print content that displayed with the drawText method of Canvas.java when ro.debug.drawtext is set to true. This allows us to capture the contents on the screeen which will help us capture benchmark results for thirdparty apps which use drawText of Canvas to display results. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--graphics/java/android/graphics/Canvas.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index c851844bc2d3..b0e5d43820ee 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -14,12 +14,14 @@
* limitations under the License.
*/
+import android.os.SystemProperties;
package android.graphics;
import android.text.GraphicsOperations;
import android.text.SpannableString;
import android.text.SpannedString;
import android.text.TextUtils;
+import android.util.Log;
import javax.microedition.khronos.opengles.GL;
@@ -37,6 +39,8 @@ import javax.microedition.khronos.opengles.GL;
* Canvas and Drawables</a> developer guide.</p></div>
*/
public class Canvas {
+ static final String LOG_TAG = "Canvas";
+
// assigned in constructors or setBitmap, freed in finalizer
int mNativeCanvas;
@@ -1356,6 +1360,9 @@ public class Canvas {
* @param paint The paint used for the text (e.g. color, size, style)
*/
public void drawText(char[] text, int index, int count, float x, float y, Paint paint) {
+ if (SystemProperties.getBoolean("ro.debug.drawtext", false)) {
+ Log.d(LOG_TAG, text);
+ }
if ((index | count | (index + count) |
(text.length - index - count)) < 0) {
throw new IndexOutOfBoundsException();