Merge branch 'froyo' into froyo-release

This commit is contained in:
The Android Automerger 2010-04-21 10:46:43 -07:00
commit 9a1ae89f87
6 changed files with 42 additions and 83 deletions

View File

@ -36,8 +36,7 @@ public:
// flags returned by getFlags()
enum {
READ_ONLY = 0x00000001,
MAP_ONCE = 0x00000002
READ_ONLY = 0x00000001
};
virtual int getHeapID() const = 0;

View File

@ -32,7 +32,6 @@ class MemoryHeapBase : public virtual BnMemoryHeap
public:
enum {
READ_ONLY = IMemoryHeap::READ_ONLY,
MAP_ONCE = IMemoryHeap::MAP_ONCE,
// memory won't be mapped locally, but will be mapped in the remote
// process.
DONT_MAP_LOCALLY = 0x00000100,

View File

@ -46,8 +46,7 @@ public:
sp<MemoryHeapPmem> mClientHeap;
};
MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap,
uint32_t flags = IMemoryHeap::MAP_ONCE);
MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap, uint32_t flags = 0);
~MemoryHeapPmem();
/* HeapInterface additions */

View File

@ -302,7 +302,7 @@ ssize_t A2dpAudioInterface::A2dpAudioStreamOut::write(const void* buffer, size_t
Error:
// Simulate audio output timing in case of error
usleep(bytes * 1000000 / frameSize() / sampleRate());
usleep(((bytes * 1000 )/ frameSize() / sampleRate()) * 1000);
return status;
}

View File

@ -46,7 +46,6 @@ public:
virtual void binderDied(const wp<IBinder>& who);
sp<IMemoryHeap> find_heap(const sp<IBinder>& binder);
void pin_heap(const sp<IBinder>& binder);
void free_heap(const sp<IBinder>& binder);
sp<IMemoryHeap> get_heap(const sp<IBinder>& binder);
void dump_heaps();
@ -100,13 +99,9 @@ private:
static inline void dump_heaps() {
gHeapCache->dump_heaps();
}
void inline pin_heap() const {
gHeapCache->pin_heap(const_cast<BpMemoryHeap*>(this)->asBinder());
}
void assertMapped() const;
void assertReallyMapped() const;
void pinHeap() const;
mutable volatile int32_t mHeapId;
mutable void* mBase;
@ -320,11 +315,6 @@ void BpMemoryHeap::assertReallyMapped() const
asBinder().get(), size, fd, strerror(errno));
close(fd);
} else {
if (flags & MAP_ONCE) {
//LOGD("pinning heap (binder=%p, size=%d, fd=%d",
// asBinder().get(), size, fd);
pin_heap();
}
mSize = size;
mFlags = flags;
android_atomic_write(fd, &mHeapId);
@ -421,19 +411,6 @@ sp<IMemoryHeap> HeapCache::find_heap(const sp<IBinder>& binder)
}
}
void HeapCache::pin_heap(const sp<IBinder>& binder)
{
Mutex::Autolock _l(mHeapCacheLock);
ssize_t i = mHeapCache.indexOfKey(binder);
if (i>=0) {
heap_info_t& info(mHeapCache.editValueAt(i));
android_atomic_inc(&info.count);
binder->linkToDeath(this);
} else {
LOGE("pin_heap binder=%p not found!!!", binder.get());
}
}
void HeapCache::free_heap(const sp<IBinder>& binder) {
free_heap( wp<IBinder>(binder) );
}

View File

@ -437,64 +437,49 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
Region::const_iterator it = clip.begin();
Region::const_iterator const end = clip.end();
if (UNLIKELY(transformed()
|| !(mFlags & DisplayHardware::DRAW_TEXTURE_EXTENSION) ))
{
//StopWatch watch("GL transformed");
const GLfixed texCoords[4][2] = {
{ 0, 0 },
{ 0, 0x10000 },
{ 0x10000, 0x10000 },
{ 0x10000, 0 }
};
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
//StopWatch watch("GL transformed");
const GLfixed texCoords[4][2] = {
{ 0, 0 },
{ 0, 0x10000 },
{ 0x10000, 0x10000 },
{ 0x10000, 0 }
};
// the texture's source is rotated
switch (texture.transform) {
case HAL_TRANSFORM_ROT_90:
glTranslatef(0, 1, 0);
glRotatef(-90, 0, 0, 1);
break;
case HAL_TRANSFORM_ROT_180:
glTranslatef(1, 1, 0);
glRotatef(-180, 0, 0, 1);
break;
case HAL_TRANSFORM_ROT_270:
glTranslatef(1, 0, 0);
glRotatef(-270, 0, 0, 1);
break;
}
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
if (texture.NPOTAdjust) {
glScalef(texture.wScale, texture.hScale, 1.0f);
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(2, GL_FIXED, 0, mVertices);
glTexCoordPointer(2, GL_FIXED, 0, texCoords);
while (it != end) {
const Rect& r = *it++;
const GLint sy = fbHeight - (r.top + r.height());
glScissor(r.left, sy, r.width(), r.height());
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
} else {
GLint crop[4] = { 0, height, width, -height };
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
int x = tx();
int y = ty();
y = fbHeight - (y + height);
while (it != end) {
const Rect& r = *it++;
const GLint sy = fbHeight - (r.top + r.height());
glScissor(r.left, sy, r.width(), r.height());
glDrawTexiOES(x, y, 0, width, height);
}
// the texture's source is rotated
switch (texture.transform) {
case HAL_TRANSFORM_ROT_90:
glTranslatef(0, 1, 0);
glRotatef(-90, 0, 0, 1);
break;
case HAL_TRANSFORM_ROT_180:
glTranslatef(1, 1, 0);
glRotatef(-180, 0, 0, 1);
break;
case HAL_TRANSFORM_ROT_270:
glTranslatef(1, 0, 0);
glRotatef(-270, 0, 0, 1);
break;
}
if (texture.NPOTAdjust) {
glScalef(texture.wScale, texture.hScale, 1.0f);
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(2, GL_FIXED, 0, mVertices);
glTexCoordPointer(2, GL_FIXED, 0, texCoords);
while (it != end) {
const Rect& r = *it++;
const GLint sy = fbHeight - (r.top + r.height());
glScissor(r.left, sy, r.width(), r.height());
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LayerBase::validateTexture(GLint textureName) const