Merge "Remove inappropriate triangle icons from quick settings panel." into honeycomb
diff --git a/api/11.xml b/api/11.xml
index a997996..5f3cd51 100644
--- a/api/11.xml
+++ b/api/11.xml
@@ -39712,6 +39712,16 @@
visibility="public"
>
</field>
+<field name="previewImage"
+ type="int"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="provider"
type="android.content.ComponentName"
transient="false"
@@ -146705,6 +146715,17 @@
visibility="public"
>
</method>
+<method name="detectActivityLeaks"
+ return="android.os.StrictMode.VmPolicy.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="detectAll"
return="android.os.StrictMode.VmPolicy.Builder"
abstract="false"
@@ -249479,7 +249500,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangedListener">
+<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangeListener">
</parameter>
</method>
<method name="setValue"
@@ -249586,7 +249607,7 @@
>
</field>
</interface>
-<interface name="NumberPicker.OnValueChangedListener"
+<interface name="NumberPicker.OnValueChangeListener"
abstract="true"
static="true"
final="false"
diff --git a/api/current.xml b/api/current.xml
index d297a24..5f3cd51 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -249500,7 +249500,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangedListener">
+<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangeListener">
</parameter>
</method>
<method name="setValue"
@@ -249607,7 +249607,7 @@
>
</field>
</interface>
-<interface name="NumberPicker.OnValueChangedListener"
+<interface name="NumberPicker.OnValueChangeListener"
abstract="true"
static="true"
final="false"
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index ec6eaaa..2aef860 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1762,8 +1762,11 @@
/**
* Set the activity content from a layout resource. The resource will be
* inflated, adding all top-level views to the activity.
- *
+ *
* @param layoutResID Resource ID to be inflated.
+ *
+ * @see #setContentView(android.view.View)
+ * @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
public void setContentView(int layoutResID) {
getWindow().setContentView(layoutResID);
@@ -1773,9 +1776,17 @@
/**
* Set the activity content to an explicit view. This view is placed
* directly into the activity's view hierarchy. It can itself be a complex
- * view hierarhcy.
+ * view hierarchy. When calling this method, the layout parameters of the
+ * specified view are ignored. Both the width and the height of the view are
+ * set by default to {@link ViewGroup.LayoutParams#MATCH_PARENT}. To use
+ * your own layout parameters, invoke
+ * {@link #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)}
+ * instead.
*
* @param view The desired content to display.
+ *
+ * @see #setContentView(int)
+ * @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
public void setContentView(View view) {
getWindow().setContentView(view);
@@ -1785,10 +1796,13 @@
/**
* Set the activity content to an explicit view. This view is placed
* directly into the activity's view hierarchy. It can itself be a complex
- * view hierarhcy.
+ * view hierarchy.
*
* @param view The desired content to display.
* @param params Layout parameters for the view.
+ *
+ * @see #setContentView(android.view.View)
+ * @see #setContentView(int)
*/
public void setContentView(View view, ViewGroup.LayoutParams params) {
getWindow().setContentView(view, params);
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 079d4cf..50e56c7 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -570,6 +570,9 @@
} catch (NameNotFoundException e) {
Log.w("PackageManager", "Failure retrieving resources for"
+ appInfo.packageName);
+ } catch (Resources.NotFoundException e) {
+ Log.w("PackageManager", "Failure retrieving resources for"
+ + appInfo.packageName + ": " + e.getMessage());
} catch (RuntimeException e) {
// If an exception was thrown, fall through to return
// default icon.
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index 1f15628..97983ba 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -489,17 +489,17 @@
// Try to enable hardware acceleration if requested
if (attrs != null &&
(attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) {
- // Don't enable hardware acceleration when we're not on the main thread
- if (Looper.getMainLooper() != Looper.myLooper()) {
- Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware acceleration "
- + "outside of the main thread, aborting");
- return;
- }
-
// Only enable hardware acceleration if we are not in the system process
// The window manager creates ViewRoots to display animated preview windows
// of launching apps and we don't want those to be hardware accelerated
if (!HardwareRenderer.sRendererDisabled) {
+ // Don't enable hardware acceleration when we're not on the main thread
+ if (Looper.getMainLooper() != Looper.myLooper()) {
+ Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware "
+ + "acceleration outside of the main thread, aborting");
+ return;
+ }
+
final boolean translucent = attrs.format != PixelFormat.OPAQUE;
if (mAttachInfo.mHardwareRenderer != null) {
mAttachInfo.mHardwareRenderer.destroy(true);
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 82e6964..f5ad6fe 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -5405,6 +5405,7 @@
case MotionEvent.ACTION_DOWN: {
mPreventDefault = PREVENT_DEFAULT_NO;
mConfirmMove = false;
+ mIsHandlingMultiTouch = false;
mInitialHitTestResult = null;
if (!mScroller.isFinished()) {
// stop the current scroll animation, but if this is
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index af5de8a..f1786e2 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -30,7 +30,7 @@
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
-import android.widget.NumberPicker.OnValueChangedListener;
+import android.widget.NumberPicker.OnValueChangeListener;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -154,7 +154,7 @@
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(layoutResourceId, this, true);
- OnValueChangedListener onChangeListener = new OnValueChangedListener() {
+ OnValueChangeListener onChangeListener = new OnValueChangeListener() {
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
updateDate(mYearSpinner.getValue(), mMonthSpinner.getValue(), mDaySpinner
.getValue());
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 19c9803..08db207 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -188,7 +188,7 @@
/**
* Listener to be notified upon current value change.
*/
- private OnValueChangedListener mOnValueChangedListener;
+ private OnValueChangeListener mOnValueChangeListener;
/**
* Listener to be notified upon scroll state change.
@@ -362,7 +362,7 @@
/**
* Interface to listen for changes of the current value.
*/
- public interface OnValueChangedListener {
+ public interface OnValueChangeListener {
/**
* Called upon a change of the current value.
@@ -808,8 +808,8 @@
*
* @param onValueChangedListener The listener.
*/
- public void setOnValueChangedListener(OnValueChangedListener onValueChangedListener) {
- mOnValueChangedListener = onValueChangedListener;
+ public void setOnValueChangedListener(OnValueChangeListener onValueChangedListener) {
+ mOnValueChangeListener = onValueChangedListener;
}
/**
@@ -1432,8 +1432,8 @@
* NumberPicker.
*/
private void notifyChange(int previous, int current) {
- if (mOnValueChangedListener != null) {
- mOnValueChangedListener.onValueChange(this, previous, mValue);
+ if (mOnValueChangeListener != null) {
+ mOnValueChangeListener.onValueChange(this, previous, mValue);
}
}
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index 26fbbbd..2688b95 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -26,7 +26,7 @@
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
-import android.widget.NumberPicker.OnValueChangedListener;
+import android.widget.NumberPicker.OnValueChangeListener;
import java.text.DateFormatSymbols;
import java.util.Calendar;
@@ -125,7 +125,7 @@
// hour
mHourSpinner = (NumberPicker) findViewById(R.id.hour);
- mHourSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangedListener() {
+ mHourSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
public void onValueChange(NumberPicker spinner, int oldVal, int newVal) {
if (!is24HourView()) {
int minValue = mHourSpinner.getMinValue();
@@ -154,7 +154,7 @@
mMinuteSpinner.setMaxValue(59);
mMinuteSpinner.setOnLongPressUpdateInterval(100);
mMinuteSpinner.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
- mMinuteSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangedListener() {
+ mMinuteSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
public void onValueChange(NumberPicker spinner, int oldVal, int newVal) {
int minValue = mMinuteSpinner.getMinValue();
int maxValue = mMinuteSpinner.getMaxValue();
@@ -200,7 +200,7 @@
mAmPmSpinner.setMinValue(0);
mAmPmSpinner.setMaxValue(1);
mAmPmSpinner.setDisplayedValues(mAmPmStrings);
- mAmPmSpinner.setOnValueChangedListener(new OnValueChangedListener() {
+ mAmPmSpinner.setOnValueChangedListener(new OnValueChangeListener() {
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
picker.requestFocus();
mIsAm = !mIsAm;
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 619a293..1bce332 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -1111,6 +1111,7 @@
if (value.dataType == Res_value::TYPE_REFERENCE && value.data == 0) {
DEBUG_STYLES(LOGI("-> Setting to @null!"));
value.dataType = Res_value::TYPE_NULL;
+ block = kXmlBlock;
}
DEBUG_STYLES(LOGI("Attribute 0x%08x: type=0x%x, data=0x%08x",
diff --git a/docs/html/guide/tutorials/views/hello-webview.jd b/docs/html/guide/tutorials/views/hello-webview.jd
index c4388ea..a927b04 100644
--- a/docs/html/guide/tutorials/views/hello-webview.jd
+++ b/docs/html/guide/tutorials/views/hello-webview.jd
@@ -12,8 +12,8 @@
<pre>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
android:orientation="vertical">
<WebView
@@ -69,7 +69,7 @@
<li>Now, in the <code>onCreate()</code> method, set an instance of the <code>HelloWebViewClient</code>
as our WebViewClient:
- <pre>webview.setWebViewClient(new WebViewClientDemo());</pre>
+ <pre>webview.setWebViewClient(new HelloWebViewClient());</pre>
<p>This line should immediately follow the initialization of our WebView object.</p>
<p>What we've done is create a WebViewClient that will load any URL selected in our
diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h
index 9d589cf..eb599b5 100644
--- a/include/private/surfaceflinger/SharedBufferStack.h
+++ b/include/private/surfaceflinger/SharedBufferStack.h
@@ -105,7 +105,7 @@
volatile int32_t head; // server's current front buffer
volatile int32_t available; // number of dequeue-able buffers
volatile int32_t queued; // number of buffers waiting for post
- volatile int32_t inUse; // buffer currently in use by SF
+ volatile int32_t reserved1;
volatile status_t status; // surface's status code
// not part of the conditions
@@ -275,7 +275,6 @@
int32_t identity);
ssize_t retireAndLock();
- status_t unlock(int buffer);
void setStatus(status_t status);
status_t reallocateAll();
status_t reallocateAllExcept(int buffer);
@@ -356,12 +355,6 @@
inline const char* name() const { return "BuffersAvailableCondition"; }
};
- struct UnlockUpdate : public UpdateBase {
- const int lockedBuffer;
- inline UnlockUpdate(SharedBufferBase* sbb, int lockedBuffer);
- inline ssize_t operator()();
- };
-
struct RetireUpdate : public UpdateBase {
const int numBuffers;
inline RetireUpdate(SharedBufferBase* sbb, int numBuffers);
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index c03c347..aa0ceb7 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -31,8 +31,8 @@
#include "GradientCache.h"
#include "PatchCache.h"
#include "ProgramCache.h"
-#include "PathCache.h"
#include "ShapeCache.h"
+#include "PathCache.h"
#include "TextDropShadowCache.h"
#include "FboCache.h"
#include "ResourceCache.h"
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 014519e..6236684 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -42,9 +42,6 @@
// This flag requires DEBUG_PATCHES to be turned on
#define DEBUG_PATCHES_EMPTY_VERTICES 0
-// Turn on to display debug info about paths
-#define DEBUG_PATHS 0
-
// Turn on to display debug info about shapes
#define DEBUG_SHAPES 0
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 3184598..28c302e 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -16,11 +16,6 @@
#define LOG_TAG "OpenGLRenderer"
-#include <GLES2/gl2.h>
-
-#include <SkCanvas.h>
-#include <SkRect.h>
-
#include <utils/threads.h>
#include "PathCache.h"
@@ -30,87 +25,11 @@
namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
-// Constructors/destructor
+// Path cache
///////////////////////////////////////////////////////////////////////////////
-PathCache::PathCache():
- mCache(GenerationCache<PathCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(MB(DEFAULT_PATH_CACHE_SIZE)) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_PATH_CACHE_SIZE, property, NULL) > 0) {
- LOGD(" Setting path cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- LOGD(" Using default path cache size of %.2fMB", DEFAULT_PATH_CACHE_SIZE);
- }
- init();
-}
-
-PathCache::PathCache(uint32_t maxByteSize):
- mCache(GenerationCache<PathCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(maxByteSize) {
- init();
-}
-
-PathCache::~PathCache() {
- mCache.clear();
-}
-
-void PathCache::init() {
- mCache.setOnEntryRemovedListener(this);
-
- GLint maxTextureSize;
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
- mMaxTextureSize = maxTextureSize;
-
- mDebugEnabled = readDebugLevel() & kDebugCaches;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Size management
-///////////////////////////////////////////////////////////////////////////////
-
-uint32_t PathCache::getSize() {
- return mSize;
-}
-
-uint32_t PathCache::getMaxSize() {
- return mMaxSize;
-}
-
-void PathCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Callbacks
-///////////////////////////////////////////////////////////////////////////////
-
-void PathCache::operator()(PathCacheEntry& path, PathTexture*& texture) {
- removeTexture(texture);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Caching
-///////////////////////////////////////////////////////////////////////////////
-
-void PathCache::removeTexture(PathTexture* texture) {
- if (texture) {
- const uint32_t size = texture->width * texture->height;
- mSize -= size;
-
- PATH_LOGD("PathCache::callback: delete path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
- if (mDebugEnabled) {
- LOGD("Path deleted, size = %d", size);
- }
-
- glDeleteTextures(1, &texture->id);
- delete texture;
- }
+PathCache::PathCache(): ShapeCache<PathCacheEntry>("path",
+ PROPERTY_PATH_CACHE_SIZE, DEFAULT_PATH_CACHE_SIZE) {
}
void PathCache::remove(SkPath* path) {
@@ -159,103 +78,5 @@
return texture;
}
-PathTexture* PathCache::addTexture(const PathCacheEntry& entry,
- const SkPath *path, const SkPaint* paint) {
- const SkRect& bounds = path->getBounds();
-
- const float pathWidth = fmax(bounds.width(), 1.0f);
- const float pathHeight = fmax(bounds.height(), 1.0f);
-
- if (pathWidth > mMaxTextureSize || pathHeight > mMaxTextureSize) {
- LOGW("Path too large to be rendered into a texture");
- return NULL;
- }
-
- const float offset = entry.strokeWidth * 1.5f;
- const uint32_t width = uint32_t(pathWidth + offset * 2.0 + 0.5);
- const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5);
-
- const uint32_t size = width * height;
- // Don't even try to cache a bitmap that's bigger than the cache
- if (size < mMaxSize) {
- while (mSize + size > mMaxSize) {
- mCache.removeOldest();
- }
- }
-
- PathTexture* texture = new PathTexture;
- texture->left = bounds.fLeft;
- texture->top = bounds.fTop;
- texture->offset = offset;
- texture->width = width;
- texture->height = height;
- texture->generation = path->getGenerationID();
-
- SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kA8_Config, width, height);
- bitmap.allocPixels();
- bitmap.eraseColor(0);
-
- SkPaint pathPaint(*paint);
-
- // Make sure the paint is opaque, color, alpha, filter, etc.
- // will be applied later when compositing the alpha8 texture
- pathPaint.setColor(0xff000000);
- pathPaint.setAlpha(255);
- pathPaint.setColorFilter(NULL);
- pathPaint.setMaskFilter(NULL);
- pathPaint.setShader(NULL);
- SkXfermode* mode = SkXfermode::Create(SkXfermode::kSrc_Mode);
- pathPaint.setXfermode(mode)->safeUnref();
-
- SkCanvas canvas(bitmap);
- canvas.translate(-bounds.fLeft + offset, -bounds.fTop + offset);
- canvas.drawPath(*path, pathPaint);
-
- generateTexture(bitmap, texture);
-
- if (size < mMaxSize) {
- mSize += size;
- PATH_LOGD("PathCache::get: create path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
- if (mDebugEnabled) {
- LOGD("Path created, size = %d", size);
- }
- mCache.put(entry, texture);
- } else {
- texture->cleanup = true;
- }
-
- return texture;
-}
-
-void PathCache::clear() {
- mCache.clear();
-}
-
-void PathCache::generateTexture(SkBitmap& bitmap, Texture* texture) {
- SkAutoLockPixels alp(bitmap);
- if (!bitmap.readyToDraw()) {
- LOGE("Cannot generate texture from bitmap");
- return;
- }
-
- glGenTextures(1, &texture->id);
-
- glBindTexture(GL_TEXTURE_2D, texture->id);
- // Textures are Alpha8
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- texture->blend = true;
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, texture->width, texture->height, 0,
- GL_ALPHA, GL_UNSIGNED_BYTE, bitmap.getPixels());
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-}
-
}; // namespace uirenderer
}; // namespace android
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index ae2e55d..dc67e16 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -17,123 +17,54 @@
#ifndef ANDROID_HWUI_PATH_CACHE_H
#define ANDROID_HWUI_PATH_CACHE_H
-#include <SkBitmap.h>
-#include <SkPaint.h>
-#include <SkPath.h>
-
#include <utils/Vector.h>
#include "Debug.h"
-#include "Texture.h"
+#include "ShapeCache.h"
+
#include "utils/Compare.h"
-#include "utils/GenerationCache.h"
namespace android {
namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
-// Defines
-///////////////////////////////////////////////////////////////////////////////
-
-// Debug
-#if DEBUG_PATHS
- #define PATH_LOGD(...) LOGD(__VA_ARGS__)
-#else
- #define PATH_LOGD(...)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
// Classes
///////////////////////////////////////////////////////////////////////////////
-/**
- * Describe a path in the path cache.
- */
-struct PathCacheEntry {
- PathCacheEntry() {
+struct PathCacheEntry: public ShapeCacheEntry {
+ PathCacheEntry(SkPath* path, SkPaint* paint):
+ ShapeCacheEntry(ShapeCacheEntry::kShapePath, paint) {
+ this->path = path;
+ }
+
+ PathCacheEntry(): ShapeCacheEntry() {
path = NULL;
- join = SkPaint::kDefault_Join;
- cap = SkPaint::kDefault_Cap;
- style = SkPaint::kFill_Style;
- miter = 4.0f;
- strokeWidth = 1.0f;
}
PathCacheEntry(const PathCacheEntry& entry):
- path(entry.path), join(entry.join), cap(entry.cap),
- style(entry.style), miter(entry.miter),
- strokeWidth(entry.strokeWidth) {
+ ShapeCacheEntry(entry) {
+ path = entry.path;
}
- PathCacheEntry(SkPath* path, SkPaint* paint) {
- this->path = path;
- join = paint->getStrokeJoin();
- cap = paint->getStrokeCap();
- miter = paint->getStrokeMiter();
- strokeWidth = paint->getStrokeWidth();
- style = paint->getStyle();
- }
-
- SkPath* path;
- SkPaint::Join join;
- SkPaint::Cap cap;
- SkPaint::Style style;
- float miter;
- float strokeWidth;
-
- bool operator<(const PathCacheEntry& rhs) const {
+ bool lessThan(const ShapeCacheEntry& r) const {
+ const PathCacheEntry& rhs = (const PathCacheEntry&) r;
LTE_INT(path) {
- LTE_INT(join) {
- LTE_INT(cap) {
- LTE_INT(style) {
- LTE_FLOAT(miter) {
- LTE_FLOAT(strokeWidth) return false;
- }
- }
- }
- }
+ return false;
}
return false;
}
-}; // struct PathCacheEntry
-/**
- * Alpha texture used to represent a path.
- */
-struct PathTexture: public Texture {
- PathTexture(): Texture() {
- }
-
- /**
- * Left coordinate of the path bounds.
- */
- float left;
- /**
- * Top coordinate of the path bounds.
- */
- float top;
- /**
- * Offset to draw the path at the correct origin.
- */
- float offset;
-}; // struct PathTexture
+ SkPath* path;
+}; // PathCacheEntry
/**
* A simple LRU path cache. The cache has a maximum size expressed in bytes.
* Any texture added to the cache causing the cache to grow beyond the maximum
* allowed size will also cause the oldest texture to be kicked out.
*/
-class PathCache: public OnEntryRemoved<PathCacheEntry, PathTexture*> {
+class PathCache: public ShapeCache<PathCacheEntry> {
public:
PathCache();
- PathCache(uint32_t maxByteSize);
- ~PathCache();
-
- /**
- * Used as a callback when an entry is removed from the cache.
- * Do not invoke directly.
- */
- void operator()(PathCacheEntry& path, PathTexture*& texture);
/**
* Returns the texture associated with the specified path. If the texture
@@ -141,10 +72,6 @@
*/
PathTexture* get(SkPath* path, SkPaint* paint);
/**
- * Clears the cache. This causes all textures to be deleted.
- */
- void clear();
- /**
* Removes an entry.
*/
void remove(SkPath* path);
@@ -158,39 +85,7 @@
*/
void clearGarbage();
- /**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
- /**
- * Returns the maximum size of the cache in bytes.
- */
- uint32_t getMaxSize();
- /**
- * Returns the current size of the cache in bytes.
- */
- uint32_t getSize();
-
private:
- /**
- * Generates the texture from a bitmap into the specified texture structure.
- */
- void generateTexture(SkBitmap& bitmap, Texture* texture);
-
- void removeTexture(PathTexture* texture);
-
- PathTexture* addTexture(const PathCacheEntry& entry, const SkPath *path, const SkPaint* paint);
-
- void init();
-
- GenerationCache<PathCacheEntry, PathTexture*> mCache;
-
- uint32_t mSize;
- uint32_t mMaxSize;
- GLuint mMaxTextureSize;
-
- bool mDebugEnabled;
-
Vector<SkPath*> mGarbage;
mutable Mutex mLock;
}; // class PathCache
diff --git a/libs/hwui/ShapeCache.cpp b/libs/hwui/ShapeCache.cpp
index ffa18e3..b78eecb 100644
--- a/libs/hwui/ShapeCache.cpp
+++ b/libs/hwui/ShapeCache.cpp
@@ -21,7 +21,12 @@
namespace android {
namespace uirenderer {
-RoundRectShapeCache::RoundRectShapeCache(): ShapeCache<RoundRectShapeCacheEntry>() {
+///////////////////////////////////////////////////////////////////////////////
+// Rounded rects
+///////////////////////////////////////////////////////////////////////////////
+
+RoundRectShapeCache::RoundRectShapeCache(): ShapeCache<RoundRectShapeCacheEntry>(
+ "round rect", PROPERTY_SHAPE_CACHE_SIZE, DEFAULT_SHAPE_CACHE_SIZE) {
}
PathTexture* RoundRectShapeCache::getRoundRect(float width, float height,
@@ -41,7 +46,12 @@
return texture;
}
-CircleShapeCache::CircleShapeCache(): ShapeCache<CircleShapeCacheEntry>() {
+///////////////////////////////////////////////////////////////////////////////
+// Circles
+///////////////////////////////////////////////////////////////////////////////
+
+CircleShapeCache::CircleShapeCache(): ShapeCache<CircleShapeCacheEntry>(
+ "circle", PROPERTY_SHAPE_CACHE_SIZE, DEFAULT_SHAPE_CACHE_SIZE) {
}
PathTexture* CircleShapeCache::getCircle(float radius, SkPaint* paint) {
diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h
index 910d01d..c8bcfc2 100644
--- a/libs/hwui/ShapeCache.h
+++ b/libs/hwui/ShapeCache.h
@@ -19,11 +19,17 @@
#include <GLES2/gl2.h>
+#include <SkBitmap.h>
#include <SkCanvas.h>
+#include <SkPaint.h>
+#include <SkPath.h>
#include <SkRect.h>
-#include "PathCache.h"
+#include "Debug.h"
#include "Properties.h"
+#include "Texture.h"
+#include "utils/Compare.h"
+#include "utils/GenerationCache.h"
namespace android {
namespace uirenderer {
@@ -44,6 +50,27 @@
///////////////////////////////////////////////////////////////////////////////
/**
+ * Alpha texture used to represent a path.
+ */
+struct PathTexture: public Texture {
+ PathTexture(): Texture() {
+ }
+
+ /**
+ * Left coordinate of the path bounds.
+ */
+ float left;
+ /**
+ * Top coordinate of the path bounds.
+ */
+ float top;
+ /**
+ * Offset to draw the path at the correct origin.
+ */
+ float offset;
+}; // struct PathTexture
+
+/**
* Describe a shape in the shape cache.
*/
struct ShapeCacheEntry {
@@ -52,7 +79,8 @@
kShapeRoundRect,
kShapeCircle,
kShapeOval,
- kShapeArc
+ kShapeArc,
+ kShapePath
};
ShapeCacheEntry() {
@@ -196,8 +224,7 @@
template<typename Entry>
class ShapeCache: public OnEntryRemoved<Entry, PathTexture*> {
public:
- ShapeCache();
- ShapeCache(uint32_t maxByteSize);
+ ShapeCache(const char* name, const char* propertyName, float defaultSize);
~ShapeCache();
/**
@@ -231,22 +258,23 @@
return mCache.get(entry);
}
-private:
- /**
- * Generates the texture from a bitmap into the specified texture structure.
- */
- void generateTexture(SkBitmap& bitmap, Texture* texture);
-
void removeTexture(PathTexture* texture);
- void init();
-
GenerationCache<Entry, PathTexture*> mCache;
uint32_t mSize;
uint32_t mMaxSize;
GLuint mMaxTextureSize;
+ char* mName;
bool mDebugEnabled;
+
+private:
+ /**
+ * Generates the texture from a bitmap into the specified texture structure.
+ */
+ void generateTexture(SkBitmap& bitmap, Texture* texture);
+
+ void init();
}; // class ShapeCache
class RoundRectShapeCache: public ShapeCache<RoundRectShapeCacheEntry> {
@@ -269,29 +297,29 @@
///////////////////////////////////////////////////////////////////////////////
template<class Entry>
-ShapeCache<Entry>::ShapeCache():
+ShapeCache<Entry>::ShapeCache(const char* name, const char* propertyName, float defaultSize):
mCache(GenerationCache<ShapeCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(MB(DEFAULT_SHAPE_CACHE_SIZE)) {
+ mSize(0), mMaxSize(MB(defaultSize)) {
char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_SHAPE_CACHE_SIZE, property, NULL) > 0) {
- LOGD(" Setting shape cache size to %sMB", property);
+ if (property_get(propertyName, property, NULL) > 0) {
+ LOGD(" Setting %s cache size to %sMB", name, property);
setMaxSize(MB(atof(property)));
} else {
- LOGD(" Using default shape cache size of %.2fMB", DEFAULT_SHAPE_CACHE_SIZE);
+ LOGD(" Using default %s cache size of %.2fMB", name, defaultSize);
}
- init();
-}
-template<class Entry>
-ShapeCache<Entry>::ShapeCache(uint32_t maxByteSize):
- mCache(GenerationCache<ShapeCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(maxByteSize) {
+ size_t len = strlen(name);
+ mName = new char[len + 1];
+ strcpy(mName, name);
+ mName[len] = '\0';
+
init();
}
template<class Entry>
ShapeCache<Entry>::~ShapeCache() {
mCache.clear();
+ delete[] mName;
}
template<class Entry>
@@ -346,10 +374,10 @@
const uint32_t size = texture->width * texture->height;
mSize -= size;
- SHAPE_LOGD("ShapeCache::callback: delete path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
+ SHAPE_LOGD("ShapeCache::callback: delete %s: name, size, mSize = %d, %d, %d",
+ mName, texture->id, size, mSize);
if (mDebugEnabled) {
- LOGD("Path deleted, size = %d", size);
+ LOGD("Shape %s deleted, size = %d", mName, size);
}
glDeleteTextures(1, &texture->id);
@@ -366,7 +394,7 @@
const float pathHeight = fmax(bounds.height(), 1.0f);
if (pathWidth > mMaxTextureSize || pathHeight > mMaxTextureSize) {
- LOGW("Shape too large to be rendered into a texture");
+ LOGW("Shape %s too large to be rendered into a texture", mName);
return NULL;
}
@@ -415,10 +443,10 @@
if (size < mMaxSize) {
mSize += size;
- SHAPE_LOGD("ShapeCache::get: create path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
+ SHAPE_LOGD("ShapeCache::get: create %s: name, size, mSize = %d, %d, %d",
+ mName, texture->id, size, mSize);
if (mDebugEnabled) {
- LOGD("Shape created, size = %d", size);
+ LOGD("Shape %s created, size = %d", mName, size);
}
mCache.put(entry, texture);
} else {
diff --git a/libs/rs/java/tests/src/com/android/rs/test/math.rs b/libs/rs/java/tests/src/com/android/rs/test/math.rs
index 3ff7910..02993fe 100644
--- a/libs/rs/java/tests/src/com/android/rs/test/math.rs
+++ b/libs/rs/java/tests/src/com/android/rs/test/math.rs
@@ -83,7 +83,7 @@
i4 = fnc(f4);
-static bool test_math(uint32_t index) {
+static bool test_fp_math(uint32_t index) {
bool failed = false;
start();
@@ -159,10 +159,10 @@
float time = end(index);
if (failed) {
- rsDebug("test_math FAILED", time);
+ rsDebug("test_fp_math FAILED", time);
}
else {
- rsDebug("test_math PASSED", time);
+ rsDebug("test_fp_math PASSED", time);
}
return failed;
@@ -170,7 +170,7 @@
void math_test(uint32_t index, int test_num) {
bool failed = false;
- failed |= test_math(index);
+ failed |= test_fp_math(index);
if (failed) {
rsSendToClientBlocking(RS_MSG_TEST_FAILED);
diff --git a/libs/rs/rsScriptC_LibCL.cpp b/libs/rs/rsScriptC_LibCL.cpp
index 65b5ff4..02d33b7 100644
--- a/libs/rs/rsScriptC_LibCL.cpp
+++ b/libs/rs/rsScriptC_LibCL.cpp
@@ -24,26 +24,6 @@
using namespace android::renderscript;
-static float SC_acospi(float v) {
- return acosf(v)/ M_PI;
-}
-
-static float SC_asinpi(float v) {
- return asinf(v) / M_PI;
-}
-
-static float SC_atanpi(float v) {
- return atanf(v) / M_PI;
-}
-
-static float SC_atan2pi(float y, float x) {
- return atan2f(y, x) / M_PI;
-}
-
-static float SC_cospi(float v) {
- return cosf(v * M_PI);
-}
-
static float SC_exp10(float v) {
return pow(10.f, v);
}
@@ -83,14 +63,6 @@
return sinf(v);
}
-static float SC_sinpi(float v) {
- return sinf(v * M_PI);
-}
-
-static float SC_tanpi(float v) {
- return tanf(v * M_PI);
-}
-
//////////////////////////////////////////////////////////////////////////////
// Integer
//////////////////////////////////////////////////////////////////////////////
@@ -186,21 +158,16 @@
// OpenCL math
{ "_Z4acosf", (void *)&acosf, true },
{ "_Z5acoshf", (void *)&acoshf, true },
- { "_Z6acospif", (void *)&SC_acospi, true },
{ "_Z4asinf", (void *)&asinf, true },
{ "_Z5asinhf", (void *)&asinhf, true },
- { "_Z6asinpif", (void *)&SC_asinpi, true },
{ "_Z4atanf", (void *)&atanf, true },
{ "_Z5atan2ff", (void *)&atan2f, true },
{ "_Z5atanhf", (void *)&atanhf, true },
- { "_Z6atanpif", (void *)&SC_atanpi, true },
- { "_Z7atan2piff", (void *)&SC_atan2pi, true },
{ "_Z4cbrtf", (void *)&cbrtf, true },
{ "_Z4ceilf", (void *)&ceilf, true },
{ "_Z8copysignff", (void *)©signf, true },
{ "_Z3cosf", (void *)&cosf, true },
{ "_Z4coshf", (void *)&coshf, true },
- { "_Z5cospif", (void *)&SC_cospi, true },
{ "_Z4erfcf", (void *)&erfcf, true },
{ "_Z3erff", (void *)&erff, true },
{ "_Z3expf", (void *)&expf, true },
@@ -240,11 +207,9 @@
{ "_Z3sinf", (void *)&sinf, true },
{ "_Z6sincosfPf", (void *)&SC_sincos, true },
{ "_Z4sinhf", (void *)&sinhf, true },
- { "_Z5sinpif", (void *)&SC_sinpi, true },
{ "_Z4sqrtf", (void *)&sqrtf, true },
{ "_Z3tanf", (void *)&tanf, true },
{ "_Z4tanhf", (void *)&tanhf, true },
- { "_Z5tanpif", (void *)&SC_tanpi, true },
{ "_Z6tgammaf", (void *)&lgammaf, true }, // FIXME!!! NEEDS TO USE tgammaf
{ "_Z5truncf", (void *)&truncf, true },
diff --git a/libs/rs/scriptc/rs_cl.rsh b/libs/rs/scriptc/rs_cl.rsh
index a7e46d8..3c0496d 100644
--- a/libs/rs/scriptc/rs_cl.rsh
+++ b/libs/rs/scriptc/rs_cl.rsh
@@ -8,27 +8,31 @@
#endif
// Conversions
-#define CVT_FUNC_2(typeout, typein) \
-_RS_STATIC typeout##2 __attribute__((overloadable)) convert_##typeout##2(typein##2 v) { \
- typeout##2 r = {(typeout)v.x, (typeout)v.y}; \
- return r; \
-} \
-_RS_STATIC typeout##3 __attribute__((overloadable)) convert_##typeout##3(typein##3 v) { \
- typeout##3 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z}; \
- return r; \
-} \
-_RS_STATIC typeout##4 __attribute__((overloadable)) convert_##typeout##4(typein##4 v) { \
- typeout##4 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z, (typeout)v.w}; \
- return r; \
+#define CVT_FUNC_2(typeout, typein) \
+_RS_STATIC typeout##2 __attribute__((overloadable)) \
+ convert_##typeout##2(typein##2 v) { \
+ typeout##2 r = {(typeout)v.x, (typeout)v.y}; \
+ return r; \
+} \
+_RS_STATIC typeout##3 __attribute__((overloadable)) \
+ convert_##typeout##3(typein##3 v) { \
+ typeout##3 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z}; \
+ return r; \
+} \
+_RS_STATIC typeout##4 __attribute__((overloadable)) \
+ convert_##typeout##4(typein##4 v) { \
+ typeout##4 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z, \
+ (typeout)v.w}; \
+ return r; \
}
-#define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \
- CVT_FUNC_2(type, char) \
- CVT_FUNC_2(type, ushort) \
- CVT_FUNC_2(type, short) \
- CVT_FUNC_2(type, uint) \
- CVT_FUNC_2(type, int) \
- CVT_FUNC_2(type, float)
+#define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \
+ CVT_FUNC_2(type, char) \
+ CVT_FUNC_2(type, ushort) \
+ CVT_FUNC_2(type, short) \
+ CVT_FUNC_2(type, uint) \
+ CVT_FUNC_2(type, int) \
+ CVT_FUNC_2(type, float)
CVT_FUNC(char)
CVT_FUNC(uchar)
@@ -38,278 +42,284 @@
CVT_FUNC(uint)
CVT_FUNC(float)
-
-
// Float ops, 6.11.2
-#define FN_FUNC_FN(fnc) \
+#define FN_FUNC_FN(fnc) \
_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v) { \
- float2 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- return r; \
-} \
+ float2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v) { \
- float3 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- return r; \
-} \
+ float3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v) { \
- float4 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- r.w = fnc(v.w); \
- return r; \
+ float4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-#define IN_FUNC_FN(fnc) \
-_RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v) { \
- int2 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- return r; \
-} \
-_RS_STATIC int3 __attribute__((overloadable)) fnc(float3 v) { \
- int3 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- return r; \
-} \
-_RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v) { \
- int4 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- r.w = fnc(v.w); \
- return r; \
+#define IN_FUNC_FN(fnc) \
+_RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v) { \
+ int2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
+_RS_STATIC int3 __attribute__((overloadable)) fnc(float3 v) { \
+ int3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
+_RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v) { \
+ int4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-#define FN_FUNC_FN_FN(fnc) \
+#define FN_FUNC_FN_FN(fnc) \
_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- return r; \
-} \
+ float2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- return r; \
-} \
+ float3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- r.w = fnc(v1.w, v2.w); \
- return r; \
+ float4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
}
-#define FN_FUNC_FN_F(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- r.w = fnc(v1.w, v2); \
- return r; \
+#define FN_FUNC_FN_F(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float v2) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ r.w = fnc(v1.w, v2); \
+ return r; \
}
-#define FN_FUNC_FN_IN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- r.w = fnc(v1.w, v2.w); \
- return r; \
+#define FN_FUNC_FN_IN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
}
-#define FN_FUNC_FN_I(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- r.w = fnc(v1.w, v2); \
- return r; \
+#define FN_FUNC_FN_I(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ r.w = fnc(v1.w, v2); \
+ return r; \
}
-#define FN_FUNC_FN_PFN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 *v2) { \
- float2 r; \
- float q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 *v2) { \
- float3 r; \
- float q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 *v2) { \
- float4 r; \
- float q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- r.w = fnc(v1.w, &q); \
- v2->w = q; \
- return r; \
+#define FN_FUNC_FN_PFN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) \
+ fnc(float2 v1, float2 *v2) { \
+ float2 r; \
+ float t[2]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) \
+ fnc(float3 v1, float3 *v2) { \
+ float3 r; \
+ float t[3]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) \
+ fnc(float4 v1, float4 *v2) { \
+ float4 r; \
+ float t[4]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ r.w = fnc(v1.w, &t[3]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ v2->w = t[3]; \
+ return r; \
}
-#define FN_FUNC_FN_PIN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2) { \
- float2 r; \
- int q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2) { \
- float3 r; \
- int q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2) { \
- float4 r; \
- int q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- r.w = fnc(v1.w, &q); \
- v2->w = q; \
- return r; \
+#define FN_FUNC_FN_PIN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2) { \
+ float2 r; \
+ int t[2]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2) { \
+ float3 r; \
+ int t[3]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2) { \
+ float4 r; \
+ int t[4]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ r.w = fnc(v1.w, &t[3]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ v2->w = t[3]; \
+ return r; \
}
-#define FN_FUNC_FN_FN_FN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2, float2 v3) { \
- float2 r; \
- r.x = fnc(v1.x, v2.x, v3.x); \
- r.y = fnc(v1.y, v2.y, v3.y); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2, float3 v3) { \
- float3 r; \
- r.x = fnc(v1.x, v2.x, v3.x); \
- r.y = fnc(v1.y, v2.y, v3.y); \
- r.z = fnc(v1.z, v2.z, v3.z); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2, float4 v3) { \
- float4 r; \
- r.x = fnc(v1.x, v2.x, v3.x); \
- r.y = fnc(v1.y, v2.y, v3.y); \
- r.z = fnc(v1.z, v2.z, v3.z); \
- r.w = fnc(v1.w, v2.w, v3.w); \
- return r; \
+#define FN_FUNC_FN_FN_FN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) \
+ fnc(float2 v1, float2 v2, float2 v3) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2.x, v3.x); \
+ r.y = fnc(v1.y, v2.y, v3.y); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) \
+ fnc(float3 v1, float3 v2, float3 v3) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2.x, v3.x); \
+ r.y = fnc(v1.y, v2.y, v3.y); \
+ r.z = fnc(v1.z, v2.z, v3.z); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) \
+ fnc(float4 v1, float4 v2, float4 v3) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2.x, v3.x); \
+ r.y = fnc(v1.y, v2.y, v3.y); \
+ r.z = fnc(v1.z, v2.z, v3.z); \
+ r.w = fnc(v1.w, v2.w, v3.w); \
+ return r; \
}
-#define FN_FUNC_FN_FN_PIN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2, int2 *v3) { \
- float2 r; \
- int q; \
- r.x = fnc(v1.x, v2.x, &q); \
- v3->x = q; \
- r.y = fnc(v1.y, v2.y, &q); \
- v3->y = q; \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2, int3 *v3) { \
- float3 r; \
- int q; \
- r.x = fnc(v1.x, v2.x, &q); \
- v3->x = q; \
- r.y = fnc(v1.y, v2.y, &q); \
- v3->y = q; \
- r.z = fnc(v1.z, v2.z, &q); \
- v3->z = q; \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2, int4 *v3) { \
- float4 r; \
- int q; \
- r.x = fnc(v1.x, v2.x, &q); \
- v3->x = q; \
- r.y = fnc(v1.y, v2.y, &q); \
- v3->y = q; \
- r.z = fnc(v1.z, v2.z, &q); \
- v3->z = q; \
- r.w = fnc(v1.w, v2.w, &q); \
- v3->w = q; \
- return r; \
+#define FN_FUNC_FN_FN_PIN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) \
+ fnc(float2 v1, float2 v2, int2 *v3) { \
+ float2 r; \
+ int t[2]; \
+ r.x = fnc(v1.x, v2.x, &t[0]); \
+ r.y = fnc(v1.y, v2.y, &t[1]); \
+ v3->x = t[0]; \
+ v3->y = t[1]; \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) \
+ fnc(float3 v1, float3 v2, int3 *v3) { \
+ float3 r; \
+ int t[3]; \
+ r.x = fnc(v1.x, v2.x, &t[0]); \
+ r.y = fnc(v1.y, v2.y, &t[1]); \
+ r.z = fnc(v1.z, v2.z, &t[2]); \
+ v3->x = t[0]; \
+ v3->y = t[1]; \
+ v3->z = t[2]; \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) \
+ fnc(float4 v1, float4 v2, int4 *v3) { \
+ float4 r; \
+ int t[4]; \
+ r.x = fnc(v1.x, v2.x, &t[0]); \
+ r.y = fnc(v1.y, v2.y, &t[1]); \
+ r.z = fnc(v1.z, v2.z, &t[2]); \
+ r.w = fnc(v1.w, v2.w, &t[3]); \
+ v3->x = t[0]; \
+ v3->y = t[1]; \
+ v3->z = t[2]; \
+ v3->w = t[3]; \
+ return r; \
}
-
extern float __attribute__((overloadable)) acos(float);
FN_FUNC_FN(acos)
@@ -420,39 +430,7 @@
iptr[0] = i;
return fmin(v - i, 0x1.fffffep-1f);
}
-_RS_STATIC float2 __attribute__((overloadable)) fract(float2 v, float2 *iptr) {
- float t[2];
- float2 r;
- r.x = fract(v.x, &t[0]);
- r.y = fract(v.y, &t[1]);
- iptr[0] = t[0];
- iptr[1] = t[1];
- return r;
-}
-_RS_STATIC float3 __attribute__((overloadable)) fract(float3 v, float3 *iptr) {
- float t[3];
- float3 r;
- r.x = fract(v.x, &t[0]);
- r.y = fract(v.y, &t[1]);
- r.z = fract(v.z, &t[2]);
- iptr[0] = t[0];
- iptr[1] = t[1];
- iptr[2] = t[2];
- return r;
-}
-_RS_STATIC float4 __attribute__((overloadable)) fract(float4 v, float4 *iptr) {
- float t[4];
- float4 r;
- r.x = fract(v.x, &t[0]);
- r.y = fract(v.y, &t[1]);
- r.z = fract(v.z, &t[2]);
- r.w = fract(v.w, &t[3]);
- iptr[0] = t[0];
- iptr[1] = t[1];
- iptr[2] = t[2];
- iptr[3] = t[3];
- return r;
-}
+FN_FUNC_FN_PFN(fract)
extern float __attribute__((overloadable)) frexp(float, int *);
FN_FUNC_FN_PIN(frexp)
@@ -612,36 +590,36 @@
// Int ops (partial), 6.11.3
-#define XN_FUNC_YN(typeout, fnc, typein) \
-extern typeout __attribute__((overloadable)) fnc(typein); \
+#define XN_FUNC_YN(typeout, fnc, typein) \
+extern typeout __attribute__((overloadable)) fnc(typein); \
_RS_STATIC typeout##2 __attribute__((overloadable)) fnc(typein##2 v) { \
- typeout##2 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- return r; \
-} \
+ typeout##2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
_RS_STATIC typeout##3 __attribute__((overloadable)) fnc(typein##3 v) { \
- typeout##3 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- return r; \
-} \
+ typeout##3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
_RS_STATIC typeout##4 __attribute__((overloadable)) fnc(typein##4 v) { \
- typeout##4 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- r.w = fnc(v.w); \
- return r; \
+ typeout##4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-#define UIN_FUNC_IN(fnc) \
+#define UIN_FUNC_IN(fnc) \
XN_FUNC_YN(uchar, fnc, char) \
XN_FUNC_YN(ushort, fnc, short) \
XN_FUNC_YN(uint, fnc, int)
-#define IN_FUNC_IN(fnc) \
+#define IN_FUNC_IN(fnc) \
XN_FUNC_YN(uchar, fnc, uchar) \
XN_FUNC_YN(char, fnc, char) \
XN_FUNC_YN(ushort, fnc, ushort) \
@@ -649,33 +627,37 @@
XN_FUNC_YN(uint, fnc, uint) \
XN_FUNC_YN(int, fnc, int)
-#define XN_FUNC_XN_XN_BODY(type, fnc, body) \
-_RS_STATIC type __attribute__((overloadable)) fnc(type v1, type v2) { \
- return body; \
-} \
-_RS_STATIC type##2 __attribute__((overloadable)) fnc(type##2 v1, type##2 v2) { \
- type##2 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- return r; \
-} \
-_RS_STATIC type##3 __attribute__((overloadable)) fnc(type##3 v1, type##3 v2) { \
- type##3 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- return r; \
-} \
-_RS_STATIC type##4 __attribute__((overloadable)) fnc(type##4 v1, type##4 v2) { \
- type##4 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- r.w = fnc(v1.w, v2.w); \
- return r; \
-} \
+#define XN_FUNC_XN_XN_BODY(type, fnc, body) \
+_RS_STATIC type __attribute__((overloadable)) \
+ fnc(type v1, type v2) { \
+ return body; \
+} \
+_RS_STATIC type##2 __attribute__((overloadable)) \
+ fnc(type##2 v1, type##2 v2) { \
+ type##2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
+_RS_STATIC type##3 __attribute__((overloadable)) \
+ fnc(type##3 v1, type##3 v2) { \
+ type##3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
+_RS_STATIC type##4 __attribute__((overloadable)) \
+ fnc(type##4 v1, type##4 v2) { \
+ type##4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
+}
-#define IN_FUNC_IN_IN_BODY(fnc, body) \
+#define IN_FUNC_IN_IN_BODY(fnc, body) \
XN_FUNC_XN_XN_BODY(uchar, fnc, body) \
XN_FUNC_XN_XN_BODY(char, fnc, body) \
XN_FUNC_XN_XN_BODY(ushort, fnc, body) \
diff --git a/libs/surfaceflinger_client/SharedBufferStack.cpp b/libs/surfaceflinger_client/SharedBufferStack.cpp
index af11f97..7505d53 100644
--- a/libs/surfaceflinger_client/SharedBufferStack.cpp
+++ b/libs/surfaceflinger_client/SharedBufferStack.cpp
@@ -58,7 +58,6 @@
void SharedBufferStack::init(int32_t i)
{
- inUse = -2;
status = NO_ERROR;
identity = i;
}
@@ -199,9 +198,9 @@
SharedBufferStack& stack( *mSharedStack );
snprintf(buffer, SIZE,
"%s[ head=%2d, available=%2d, queued=%2d ] "
- "reallocMask=%08x, inUse=%2d, identity=%d, status=%d",
+ "reallocMask=%08x, identity=%d, status=%d",
prefix, stack.head, stack.available, stack.queued,
- stack.reallocMask, stack.inUse, stack.identity, stack.status);
+ stack.reallocMask, stack.identity, stack.status);
result.append(buffer);
result.append("\n");
return result;
@@ -302,22 +301,6 @@
return NO_ERROR;
}
-SharedBufferServer::UnlockUpdate::UnlockUpdate(
- SharedBufferBase* sbb, int lockedBuffer)
- : UpdateBase(sbb), lockedBuffer(lockedBuffer) {
-}
-ssize_t SharedBufferServer::UnlockUpdate::operator()() {
- if (stack.inUse != lockedBuffer) {
- LOGE("unlocking %d, but currently locked buffer is %d "
- "(identity=%d, token=%d)",
- lockedBuffer, stack.inUse,
- stack.identity, stack.token);
- return BAD_VALUE;
- }
- android_atomic_write(-1, &stack.inUse);
- return NO_ERROR;
-}
-
SharedBufferServer::RetireUpdate::RetireUpdate(
SharedBufferBase* sbb, int numBuffers)
: UpdateBase(sbb), numBuffers(numBuffers) {
@@ -327,9 +310,6 @@
if (uint32_t(head) >= SharedBufferStack::NUM_BUFFER_MAX)
return BAD_VALUE;
- // Preventively lock the current buffer before updating queued.
- android_atomic_write(stack.headBuf, &stack.inUse);
-
// Decrement the number of queued buffers
int32_t queued;
do {
@@ -345,7 +325,6 @@
head = (head + 1) % numBuffers;
const int8_t headBuf = stack.index[head];
stack.headBuf = headBuf;
- android_atomic_write(headBuf, &stack.inUse);
// head is only modified here, so we don't need to use cmpxchg
android_atomic_write(head, &stack.head);
@@ -546,13 +525,6 @@
return buf;
}
-status_t SharedBufferServer::unlock(int buf)
-{
- UnlockUpdate update(this, buf);
- status_t err = updateCondition( update );
- return err;
-}
-
void SharedBufferServer::setStatus(status_t status)
{
if (status < NO_ERROR) {
@@ -694,12 +666,6 @@
stack.head = 0;
stack.headBuf = 0;
- // If one of the buffers is in use it must be the head buffer, which we are
- // renaming to buffer 0.
- if (stack.inUse > 0) {
- stack.inUse = 0;
- }
-
// Free the buffers from the end of the list that are no longer needed.
for (int i = newNumBuffers; i < mNumBuffers; i++) {
mBufferList.remove(i);
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
index 33dda03..4cf28ee 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
@@ -61,8 +61,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal|bottom"
- android:animateLayoutChanges="true"
- android:animationCache="false"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 0d30db5..9f48b48 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.tablet;
import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
@@ -32,10 +33,10 @@
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
-import android.widget.FrameLayout;
import android.widget.TextView;
import com.android.systemui.R;
@@ -100,7 +101,6 @@
} else {
mShowing = show;
setVisibility(show ? View.VISIBLE : View.GONE);
- mChoreo.jumpTo(show);
}
}
@@ -117,50 +117,74 @@
super.onVisibilityChanged(v, vis);
// when we hide, put back the notifications
if (!isShown()) {
- switchToNotificationMode();
+ if (mSettingsView != null) removeSettingsView();
+ mNotificationScroller.setVisibility(View.VISIBLE);
+ mNotificationScroller.setAlpha(1f);
mNotificationScroller.scrollTo(0, 0);
+ updatePanelModeButtons();
}
}
- /**
- * We need to be aligned at the bottom. LinearLayout can't do this, so instead,
- * let LinearLayout do all the hard work, and then shift everything down to the bottom.
- */
+ /*
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
- mChoreo.setPanelHeight(mContentParent.getHeight());
+ if (DEBUG) Slog.d(TAG, String.format("PANEL: onLayout: (%d, %d, %d, %d)", l, t, r, b));
}
@Override
public void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
+
+ if (DEBUG) {
+ Slog.d(TAG, String.format("PANEL: onSizeChanged: (%d -> %d, %d -> %d)",
+ oldw, w, oldh, h));
+ }
}
+ */
public void onClick(View v) {
if (v == mModeToggle) {
- if (mSettingsView == null) {
- switchToSettingsMode();
- } else {
- switchToNotificationMode();
- }
+ swapPanels();
}
}
- public void switchToSettingsMode() {
- removeSettingsView();
- addSettingsView();
- mSettingsButton.setVisibility(View.INVISIBLE);
- mNotificationScroller.setVisibility(View.GONE);
- mNotificationButton.setVisibility(View.VISIBLE);
- }
+ final static int PANEL_FADE_DURATION = 150;
- public void switchToNotificationMode() {
- removeSettingsView();
- mSettingsButton.setVisibility(View.VISIBLE);
- mNotificationScroller.setVisibility(View.VISIBLE);
- mNotificationButton.setVisibility(View.INVISIBLE);
+ public void swapPanels() {
+ final View toShow, toHide;
+ if (mSettingsView == null) {
+ addSettingsView();
+ toShow = mSettingsView;
+ toHide = mNotificationScroller;
+ } else {
+ toShow = mNotificationScroller;
+ toHide = mSettingsView;
+ }
+ Animator a = ObjectAnimator.ofFloat(toHide, "alpha", 1f, 0f)
+ .setDuration(PANEL_FADE_DURATION);
+ a.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator _a) {
+ toHide.setVisibility(View.GONE);
+ toShow.setVisibility(View.VISIBLE);
+ ObjectAnimator.ofFloat(toShow, "alpha", 0f, 1f)
+ .setDuration(PANEL_FADE_DURATION)
+ .start();
+ if (toHide == mSettingsView) {
+ removeSettingsView();
+ }
+ updatePanelModeButtons();
+ }
+ });
+ a.start();
+ }
+
+ public void updatePanelModeButtons() {
+ final boolean settingsVisible = (mSettingsView != null);
+ mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.INVISIBLE);
+ mNotificationButton.setVisibility(settingsVisible ? View.VISIBLE : View.INVISIBLE);
}
public boolean isInContentArea(int x, int y) {
@@ -179,9 +203,11 @@
}
}
+ // NB: it will be invisible until you show it
void addSettingsView() {
LayoutInflater infl = LayoutInflater.from(getContext());
mSettingsView = infl.inflate(R.layout.status_bar_settings_view, mContentFrame, false);
+ mSettingsView.setVisibility(View.GONE);
mContentFrame.addView(mSettingsView);
}
@@ -191,8 +217,8 @@
AnimatorSet mContentAnim;
// should group this into a multi-property animation
- final int OPEN_DURATION = 250;
- final int CLOSE_DURATION = 250;
+ final static int OPEN_DURATION = 136;
+ final static int CLOSE_DURATION = 250;
// the panel will start to appear this many px from the end
final int HYPERSPACE_OFFRAMP = 100;
@@ -257,24 +283,6 @@
mVisible = appearing;
}
- void jumpTo(boolean appearing) {
- mContentParent.setTranslationY(appearing ? 0 : mPanelHeight);
- }
-
- public void setPanelHeight(int h) {
- if (DEBUG) Slog.d(TAG, "panelHeight=" + h);
- mPanelHeight = h;
- if (mPanelHeight == 0) {
- // fully closed, no animation necessary
- } else if (mVisible) {
- if (DEBUG) {
- Slog.d(TAG, "panelHeight not zero but trying to open; scheduling an anim"
- + " to open fully");
- }
- startAnimation(true);
- }
- }
-
public void onAnimationCancel(Animator animation) {
if (DEBUG) Slog.d(TAG, "onAnimationCancel");
// force this to zero so we close the window
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 16c042d..11ad4e4 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -5443,19 +5443,21 @@
// clear auxiliary effect input buffer for next accumulation
if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) {
- memset(mConfig.inputCfg.buffer.raw, 0, mConfig.inputCfg.buffer.frameCount*sizeof(int32_t));
+ memset(mConfig.inputCfg.buffer.raw, 0,
+ mConfig.inputCfg.buffer.frameCount*sizeof(int32_t));
}
} else if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_INSERT &&
- mConfig.inputCfg.buffer.raw != mConfig.outputCfg.buffer.raw){
- // If an insert effect is idle and input buffer is different from output buffer, copy input to
- // output
+ mConfig.inputCfg.buffer.raw != mConfig.outputCfg.buffer.raw) {
+ // If an insert effect is idle and input buffer is different from output buffer,
+ // accumulate input onto output
sp<EffectChain> chain = mChain.promote();
if (chain != 0 && chain->activeTracks() != 0) {
- size_t size = mConfig.inputCfg.buffer.frameCount * sizeof(int16_t);
- if (mConfig.inputCfg.channels == CHANNEL_STEREO) {
- size *= 2;
+ size_t frameCnt = mConfig.inputCfg.buffer.frameCount * 2; //always stereo here
+ int16_t *in = mConfig.inputCfg.buffer.s16;
+ int16_t *out = mConfig.outputCfg.buffer.s16;
+ for (size_t i = 0; i < frameCnt; i++) {
+ out[i] = clamp16((int32_t)out[i] + (int32_t)in[i]);
}
- memcpy(mConfig.outputCfg.buffer.raw, mConfig.inputCfg.buffer.raw, size);
}
}
}
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index fde68f6..3730739 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -691,22 +691,6 @@
}
}
-void Layer::finishPageFlip()
-{
- ClientRef::Access sharedClient(mUserClientRef);
- SharedBufferServer* lcblk(sharedClient.get());
- if (lcblk) {
- int buf = mBufferManager.getActiveBufferIndex();
- if (buf >= 0) {
- status_t err = lcblk->unlock( buf );
- LOGE_IF(err!=NO_ERROR,
- "layer %p, buffer=%d wasn't locked!",
- this, buf);
- }
- }
-}
-
-
void Layer::dump(String8& result, char* buffer, size_t SIZE) const
{
LayerBaseClient::dump(result, buffer, SIZE);
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 5444d2f..2908119 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -75,7 +75,6 @@
virtual uint32_t doTransaction(uint32_t transactionFlags);
virtual void lockPageFlip(bool& recomputeVisibleRegions);
virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion);
- virtual void finishPageFlip();
virtual bool needsBlending() const { return mNeedsBlending; }
virtual bool needsDithering() const { return mNeedsDithering; }
virtual bool needsFiltering() const;
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index 9ddb05f..464841b 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -273,10 +273,6 @@
}
}
-void LayerBase::finishPageFlip()
-{
-}
-
void LayerBase::invalidate()
{
if ((android_atomic_or(1, &mInvalidate)&1) == 0) {
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index 13af223..1a34f52 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -174,11 +174,6 @@
virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion);
/**
- * finishPageFlip - called after all surfaces have drawn.
- */
- virtual void finishPageFlip();
-
- /**
* needsBlending - true if this surface needs blending
*/
virtual bool needsBlending() const { return false; }
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 434e473..694af70 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -394,14 +394,10 @@
logger.log(GraphicLog::SF_SWAP_BUFFERS, index);
postFramebuffer();
- logger.log(GraphicLog::SF_UNLOCK_CLIENTS, index);
- unlockClients();
-
logger.log(GraphicLog::SF_REPAINT_DONE, index);
} else {
// pretend we did the post
hw.compositionComplete();
- unlockClients();
usleep(16667); // 60 fps period
}
return true;
@@ -872,30 +868,36 @@
for (size_t i=0 ; i<count ; i++) {
const sp<LayerBase>& layer(layers[i]);
layer->setPerFrameData(&cur[i]);
- if (cur[i].hints & HWC_HINT_CLEAR_FB) {
- if (!(layer->needsBlending())) {
- transparent.orSelf(layer->visibleRegionScreen);
- }
- }
}
err = hwc.prepare();
LOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
- }
- /*
- * clear the area of the FB that need to be transparent
- */
- transparent.andSelf(dirty);
- if (!transparent.isEmpty()) {
- glClearColor(0,0,0,0);
- Region::const_iterator it = transparent.begin();
- Region::const_iterator const end = transparent.end();
- const int32_t height = hw.getHeight();
- while (it != end) {
- const Rect& r(*it++);
- const GLint sy = height - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glClear(GL_COLOR_BUFFER_BIT);
+ if (err == NO_ERROR) {
+ for (size_t i=0 ; i<count ; i++) {
+ if (cur[i].hints & HWC_HINT_CLEAR_FB) {
+ const sp<LayerBase>& layer(layers[i]);
+ if (!(layer->needsBlending())) {
+ transparent.orSelf(layer->visibleRegionScreen);
+ }
+ }
+ }
+
+ /*
+ * clear the area of the FB that need to be transparent
+ */
+ transparent.andSelf(dirty);
+ if (!transparent.isEmpty()) {
+ glClearColor(0,0,0,0);
+ Region::const_iterator it = transparent.begin();
+ Region::const_iterator const end = transparent.end();
+ const int32_t height = hw.getHeight();
+ while (it != end) {
+ const Rect& r(*it++);
+ const GLint sy = height - (r.top + r.height());
+ glScissor(r.left, sy, r.width(), r.height());
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+ }
}
}
@@ -920,17 +922,6 @@
}
}
-void SurfaceFlinger::unlockClients()
-{
- const LayerVector& drawingLayers(mDrawingState.layersSortedByZ);
- const size_t count = drawingLayers.size();
- sp<LayerBase> const* const layers = drawingLayers.array();
- for (size_t i=0 ; i<count ; ++i) {
- const sp<LayerBase>& layer = layers[i];
- layer->finishPageFlip();
- }
-}
-
void SurfaceFlinger::debugFlashRegions()
{
const DisplayHardware& hw(graphicPlane(0).displayHardware());
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index eabdc64..6dd91ac 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -314,7 +314,6 @@
void handleRepaint();
void postFramebuffer();
void composeSurfaces(const Region& dirty);
- void unlockClients();
ssize_t addClientLayer(const sp<Client>& client,
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java
index c143424..a3d3781 100644
--- a/telephony/java/com/android/internal/telephony/DataConnection.java
+++ b/telephony/java/com/android/internal/telephony/DataConnection.java
@@ -30,6 +30,7 @@
import android.util.EventLog;
import java.net.InetAddress;
+import java.net.Inet4Address;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
@@ -448,22 +449,65 @@
NetworkInterface networkInterface = NetworkInterface.getByName(interfaceName);
linkProperties.setInterfaceName(interfaceName);
- // TODO: Get gateway and dns via RIL interface not property?
- String gatewayAddress = SystemProperties.get(prefix + "gw");
- linkProperties.setGateway(InetAddress.getByName(gatewayAddress));
+ if (response.length >= 5) {
+ log("response.length >=5 using response for ip='" + response[2] +
+ "' dns='" + response[3] + "' gateway='" + response[4] + "'");
+ String [] addresses = response[2].split(" ");
+ String [] dnses = response[3].split(" ");
+ String gateway = response[4];
+ for (String addr : addresses) {
+ LinkAddress la;
+ if (!InetAddress.isNumeric(addr)) {
+ throw new RuntimeException(
+ "Vendor ril bug: Non-numeric ip addr=" + addr);
+ }
+ InetAddress ia = InetAddress.getByName(addr);
+ if (ia instanceof Inet4Address) {
+ la = new LinkAddress(ia, 32);
+ } else {
+ la = new LinkAddress(ia, 128);
+ }
+ linkProperties.addLinkAddress(la);
+ }
- for (InterfaceAddress addr : networkInterface.getInterfaceAddresses()) {
- linkProperties.addLinkAddress(new LinkAddress(addr));
- }
- // TODO: Get gateway and dns via RIL interface not property?
- String dnsServers[] = new String[2];
- dnsServers[0] = SystemProperties.get(prefix + "dns1");
- dnsServers[1] = SystemProperties.get(prefix + "dns2");
- if (isDnsOk(dnsServers)) {
- linkProperties.addDns(InetAddress.getByName(dnsServers[0]));
- linkProperties.addDns(InetAddress.getByName(dnsServers[1]));
+ if (dnses.length != 0) {
+ for (String addr : dnses) {
+ if (!InetAddress.isNumeric(addr)) {
+ throw new RuntimeException(
+ "Vendor ril bug: Non-numeric dns addr=" + addr);
+ }
+ InetAddress ia = InetAddress.getByName(addr);
+ linkProperties.addDns(ia);
+ }
+ result = SetupResult.SUCCESS;
+ } else {
+ result = SetupResult.ERR_BadDns;
+ }
+
+ if (!InetAddress.isNumeric(gateway)) {
+ throw new RuntimeException(
+ "Vendor ril bug: Non-numeric gateway addr=" + gateway);
+ }
+ linkProperties.setGateway(InetAddress.getByName(gateway));
+
} else {
- result = SetupResult.ERR_BadDns;
+ log("response.length < 5 using properties for dns and gateway");
+ for (InterfaceAddress addr : networkInterface.getInterfaceAddresses()) {
+ linkProperties.addLinkAddress(new LinkAddress(addr));
+ }
+
+ String gatewayAddress = SystemProperties.get(prefix + "gw");
+ linkProperties.setGateway(InetAddress.getByName(gatewayAddress));
+
+ String dnsServers[] = new String[2];
+ dnsServers[0] = SystemProperties.get(prefix + "dns1");
+ dnsServers[1] = SystemProperties.get(prefix + "dns2");
+ if (isDnsOk(dnsServers)) {
+ linkProperties.addDns(InetAddress.getByName(dnsServers[0]));
+ linkProperties.addDns(InetAddress.getByName(dnsServers[1]));
+ } else {
+ result = SetupResult.ERR_BadDns;
+ }
}
} catch (UnknownHostException e1) {
log("onSetupCompleted: UnknowHostException " + e1);