summaryrefslogtreecommitdiffstats
path: root/ui/android
diff options
context:
space:
mode:
authortedchoc <tedchoc@chromium.org>2015-03-06 15:06:53 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-06 23:07:38 +0000
commita18c5707b6338c036bcd3057183a96c79988f339 (patch)
treefec1f374198c23ea0e2d81af34109d6b0c7fad0b /ui/android
parent97b833e5aeae69178c3c3088702addc88e65c747 (diff)
downloadchromium_src-a18c5707b6338c036bcd3057183a96c79988f339.zip
chromium_src-a18c5707b6338c036bcd3057183a96c79988f339.tar.gz
chromium_src-a18c5707b6338c036bcd3057183a96c79988f339.tar.bz2
[Android] Allow specifying the progress component of the toolbar as a separate texture.
The progress bar changes much more often than the contents of the toolbar, so splitting the two will allow for cheaper updates to the toolbar texture. BUG=461148 Review URL: https://codereview.chromium.org/986683002 Cr-Commit-Position: refs/heads/master@{#319523}
Diffstat (limited to 'ui/android')
-rw-r--r--ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java b/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
index 0b9c170..d17ff8f 100644
--- a/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
+++ b/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
@@ -54,7 +54,7 @@ public class ViewResourceAdapter implements DynamicResource, OnLayoutChangeListe
onCaptureStart(canvas, mDirtyRect.isEmpty() ? null : mDirtyRect);
if (!mDirtyRect.isEmpty()) canvas.clipRect(mDirtyRect);
- mView.draw(canvas);
+ capture(canvas);
onCaptureEnd();
} else {
@@ -118,7 +118,7 @@ public class ViewResourceAdapter implements DynamicResource, OnLayoutChangeListe
}
/**
- * Called before {@link View#draw(Canvas)} is called.
+ * Called before {@link #capture(Canvas)} is called.
* @param canvas The {@link Canvas} that will be drawn to.
* @param dirtyRect The dirty {@link Rect} or {@code null} if the entire area is being redrawn.
*/
@@ -126,7 +126,15 @@ public class ViewResourceAdapter implements DynamicResource, OnLayoutChangeListe
}
/**
- * Called after {@link View#draw(Canvas)}.
+ * Called to draw the {@link View}'s contents into the passed in {@link Canvas}.
+ * @param canvas The {@link Canvas} that will be drawn to.
+ */
+ protected void capture(Canvas canvas) {
+ mView.draw(canvas);
+ }
+
+ /**
+ * Called after {@link #capture(Canvas)}.
*/
protected void onCaptureEnd() {
}