summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsAllocation.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-10-26 15:19:28 -0700
committerJason Sams <rjsams@android.com>2009-10-26 15:20:43 -0700
commit83f1c63c56ed73e0dfcc4de67bc58a4df5b3fe69 (patch)
tree3295906c8047a0eab55cfeed2765cf7bacb2ee46 /libs/rs/rsAllocation.cpp
parent52c931b7dd0c5f82f409dea85a62c1e6c9e17c35 (diff)
downloadframeworks_base-83f1c63c56ed73e0dfcc4de67bc58a4df5b3fe69.zip
frameworks_base-83f1c63c56ed73e0dfcc4de67bc58a4df5b3fe69.tar.gz
frameworks_base-83f1c63c56ed73e0dfcc4de67bc58a4df5b3fe69.tar.bz2
Fix dirty state tracking of allocation attached to ProgramVertex objects when being updated while not attached.
Diffstat (limited to 'libs/rs/rsAllocation.cpp')
-rw-r--r--libs/rs/rsAllocation.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 8ac9c26..5e0959a 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -125,6 +125,7 @@ void Allocation::data(const void *data, uint32_t sizeBytes)
return;
}
memcpy(mPtr, data, size);
+ sendDirty();
}
void Allocation::read(void *data)
@@ -145,6 +146,7 @@ void Allocation::subData(uint32_t xoff, uint32_t count, const void *data, uint32
return;
}
memcpy(ptr, data, size);
+ sendDirty();
}
void Allocation::subData(uint32_t xoff, uint32_t yoff,
@@ -169,6 +171,7 @@ void Allocation::subData(uint32_t xoff, uint32_t yoff,
src += lineSize;
dst += destW * eSize;
}
+ sendDirty();
}
void Allocation::subData(uint32_t xoff, uint32_t yoff, uint32_t zoff,
@@ -176,7 +179,28 @@ void Allocation::subData(uint32_t xoff, uint32_t yoff, uint32_t zoff,
{
}
+void Allocation::addProgramToDirty(const Program *p)
+{
+ mToDirtyList.add(p);
+}
+
+void Allocation::removeProgramToDirty(const Program *p)
+{
+ for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
+ if (mToDirtyList[ct] == p) {
+ mToDirtyList.removeAt(ct);
+ return;
+ }
+ }
+ rsAssert(0);
+}
+void Allocation::sendDirty() const
+{
+ for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
+ mToDirtyList[ct]->forceDirty();
+ }
+}
/////////////////
//
@@ -412,31 +436,24 @@ RsAllocation rsi_AllocationCreateFromBitmapBoxed(Context *rsc, uint32_t w, uint3
RsAllocation ret = rsi_AllocationCreateFromBitmap(rsc, w2, h2, _dst, _src, genMips, tmp);
free(tmp);
return ret;
-
-
-
-
}
void rsi_AllocationData(Context *rsc, RsAllocation va, const void *data, uint32_t sizeBytes)
{
Allocation *a = static_cast<Allocation *>(va);
a->data(data, sizeBytes);
- rsc->allocationCheck(a);
}
void rsi_Allocation1DSubData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t count, const void *data, uint32_t sizeBytes)
{
Allocation *a = static_cast<Allocation *>(va);
a->subData(xoff, count, data, sizeBytes);
- rsc->allocationCheck(a);
}
void rsi_Allocation2DSubData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, const void *data, uint32_t sizeBytes)
{
Allocation *a = static_cast<Allocation *>(va);
a->subData(xoff, yoff, w, h, data, sizeBytes);
- rsc->allocationCheck(a);
}
void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data)