summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/HardwareRenderer.java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-05-14 18:05:36 -0700
committerAlan Viverette <alanv@google.com>2015-05-14 18:05:36 -0700
commit50210d912925aef14e4ce69be82e4949122a3cd9 (patch)
treeba87c37a8b2db6521df6f8c62307319bcf70a823 /core/java/android/view/HardwareRenderer.java
parent9cb90cbbf8fc91793dad1d1cb317079dbc7e8421 (diff)
downloadframeworks_base-50210d912925aef14e4ce69be82e4949122a3cd9.zip
frameworks_base-50210d912925aef14e4ce69be82e4949122a3cd9.tar.gz
frameworks_base-50210d912925aef14e4ce69be82e4949122a3cd9.tar.bz2
Adjust light source for window position
Bug: 16523629 Change-Id: I2f3fed1edcac0a3cfd5034aded45e08ececfebaf
Diffstat (limited to 'core/java/android/view/HardwareRenderer.java')
-rw-r--r--core/java/android/view/HardwareRenderer.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 6632f39..5e58250 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -260,7 +260,7 @@ public abstract class HardwareRenderer {
/**
* Gets the current width of the surface. This is the width that the surface
- * was last set to in a call to {@link #setup(int, int, Rect)}.
+ * was last set to in a call to {@link #setup(int, int, View.AttachInfo, Rect)}.
*
* @return the current width of the surface
*/
@@ -268,7 +268,7 @@ public abstract class HardwareRenderer {
/**
* Gets the current height of the surface. This is the height that the surface
- * was last set to in a call to {@link #setup(int, int, Rect)}.
+ * was last set to in a call to {@link #setup(int, int, View.AttachInfo, Rect)}.
*
* @return the current width of the surface
*/
@@ -373,19 +373,20 @@ public abstract class HardwareRenderer {
*
* @param width The width of the drawing surface.
* @param height The height of the drawing surface.
+ * @param attachInfo Information about the window.
* @param surface The surface to hardware accelerate
* @param surfaceInsets The drawing surface insets to apply
*
* @return true if the surface was initialized, false otherwise. Returning
* false might mean that the surface was already initialized.
*/
- boolean initializeIfNeeded(int width, int height, Surface surface, Rect surfaceInsets)
- throws OutOfResourcesException {
+ boolean initializeIfNeeded(int width, int height, View.AttachInfo attachInfo,
+ Surface surface, Rect surfaceInsets) throws OutOfResourcesException {
if (isRequested()) {
// We lost the gl context, so recreate it.
if (!isEnabled()) {
if (initialize(surface)) {
- setup(width, height, surfaceInsets);
+ setup(width, height, attachInfo, surfaceInsets);
return true;
}
}
@@ -398,9 +399,17 @@ public abstract class HardwareRenderer {
*
* @param width The width of the drawing surface.
* @param height The height of the drawing surface.
+ * @param attachInfo Information about the window.
* @param surfaceInsets The drawing surface insets to apply
*/
- abstract void setup(int width, int height, Rect surfaceInsets);
+ abstract void setup(int width, int height, View.AttachInfo attachInfo, Rect surfaceInsets);
+
+ /**
+ * Updates the light position based on the position of the window.
+ *
+ * @param attachInfo Information about the window.
+ */
+ abstract void setLightCenter(View.AttachInfo attachInfo);
/**
* Optional, sets the name of the renderer. Useful for debugging purposes.