Merge "Fix bug #5371117 Regression : The Hebrew / Arabic text behavior in ICS latest build is wrong"
diff --git a/include/binder/CursorWindow.h b/include/binder/CursorWindow.h
index f0b2909..d227244 100644
--- a/include/binder/CursorWindow.h
+++ b/include/binder/CursorWindow.h
@@ -143,8 +143,6 @@
*/
uint32_t alloc(size_t size, bool aligned = false);
- uint32_t read_field_slot(int row, int column, field_slot_t * slot);
-
/**
* Copy data into the window at the given offset.
*/
@@ -181,6 +179,32 @@
return ((field_slot_t *)offsetToPtr(fieldDirOffset)) + column;
}
+ int64_t getFieldSlotValueLong(field_slot_t* fieldSlot) {
+#if WINDOW_STORAGE_INLINE_NUMERICS
+ return fieldSlot->data.l;
+#else
+ return copyOutLong(fieldSlot->data.buffer.offset);
+#endif
+ }
+
+ double getFieldSlotValueDouble(field_slot_t* fieldSlot) {
+#if WINDOW_STORAGE_INLINE_NUMERICS
+ return fieldSlot->data.d;
+#else
+ return copyOutDouble(fieldSlot->data.buffer.offset);
+#endif
+ }
+
+#if WINDOW_STORAGE_UTF8
+ char* getFieldSlotValueString(field_slot_t* fieldSlot) {
+ return reinterpret_cast<char*>(offsetToPtr(fieldSlot->data.buffer.offset));
+ }
+#else
+ char16_t* getFieldSlotValueString(field_slot_t* fieldSlot) {
+ return reinterpret_cast<char16_t*>(offsetToPtr(fieldSlot->data.buffer.offset));
+ }
+#endif
+
private:
uint8_t * mData;
size_t mSize;
diff --git a/libs/binder/CursorWindow.cpp b/libs/binder/CursorWindow.cpp
index 47bbd04..b02374f 100644
--- a/libs/binder/CursorWindow.cpp
+++ b/libs/binder/CursorWindow.cpp
@@ -236,33 +236,6 @@
return ((field_slot_t *)offsetToPtr(fieldDirOffset)) + column;
}
-uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotOut)
-{
- if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) {
- LOGE("Can't read row# %d, col# %d from CursorWindow. Make sure your Cursor is initialized correctly.",
- row, column);
- return -1;
- }
- row_slot_t * rowSlot = getRowSlot(row);
- if (!rowSlot) {
- LOGE("Failed to find rowSlot for row %d", row);
- return -1;
- }
- if (rowSlot->offset == 0 || rowSlot->offset >= mSize) {
- LOGE("Invalid rowSlot, offset = %d", rowSlot->offset);
- return -1;
- }
-LOG_WINDOW("Found field directory for %d,%d at rowSlot %d, offset %d", row, column, (uint8_t *)rowSlot - mData, rowSlot->offset);
- field_slot_t * fieldDir = (field_slot_t *)offsetToPtr(rowSlot->offset);
-LOG_WINDOW("Read field_slot_t %d,%d: offset = %d, size = %d, type = %d", row, column, fieldDir[column].data.buffer.offset, fieldDir[column].data.buffer.size, fieldDir[column].type);
-
- // Copy the data to the out param
- slotOut->data.buffer.offset = fieldDir[column].data.buffer.offset;
- slotOut->data.buffer.size = fieldDir[column].data.buffer.size;
- slotOut->type = fieldDir[column].type;
- return 0;
-}
-
void CursorWindow::copyIn(uint32_t offset, uint8_t const * data, size_t size)
{
assert(offset + size <= mSize);
@@ -370,12 +343,8 @@
if (!fieldSlot || fieldSlot->type != FIELD_TYPE_INTEGER) {
return false;
}
-
-#if WINDOW_STORAGE_INLINE_NUMERICS
- *valueOut = fieldSlot->data.l;
-#else
- *valueOut = copyOutLong(fieldSlot->data.buffer.offset);
-#endif
+
+ *valueOut = getFieldSlotValueLong(fieldSlot);
return true;
}
@@ -386,11 +355,7 @@
return false;
}
-#if WINDOW_STORAGE_INLINE_NUMERICS
- *valueOut = fieldSlot->data.d;
-#else
- *valueOut = copyOutDouble(fieldSlot->data.buffer.offset);
-#endif
+ *valueOut = getFieldSlotValueDouble(fieldSlot);
return true;
}
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 879e858..be9b226 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -75,7 +75,7 @@
}
void HWComposer::invalidate() {
- mFlinger->signalEvent();
+ mFlinger->repaintEverything();
}
void HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) {
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 43191b7..128a64d 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -256,12 +256,11 @@
public: // hack to work around gcc 4.0.3 bug
const GraphicPlane& graphicPlane(int dpy) const;
GraphicPlane& graphicPlane(int dpy);
-private:
+ void signalEvent();
+ void repaintEverything();
- void waitForEvent();
-public: // hack to work around gcc 4.0.3 bug
- void signalEvent();
private:
+ void waitForEvent();
void handleConsoleEvents();
void handleTransaction(uint32_t transactionFlags);
void handleTransactionLocked(uint32_t transactionFlags);
@@ -279,7 +278,6 @@
void postFramebuffer();
void setupHardwareComposer(Region& dirtyInOut);
void composeSurfaces(const Region& dirty);
- void repaintEverything();
ssize_t addClientLayer(const sp<Client>& client,