summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2011-01-12 14:53:25 -0800
committerJason Sams <rjsams@android.com>2011-01-12 14:53:25 -0800
commitfb9f82ca4f11cf7e43a001f3e6fd1b381cc86210 (patch)
tree000fb80d2d73d062f9493cec84880974d77e68db /libs
parentf7086090cfc8d97b5bd3b4d7801a27af11f7c207 (diff)
downloadframeworks_base-fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210.zip
frameworks_base-fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210.tar.gz
frameworks_base-fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210.tar.bz2
Implement more of copy2DRange*
Change-Id: Id6be481c4abc968df27e5bba1ed044262ec0f293
Diffstat (limited to 'libs')
-rw-r--r--libs/rs/rsAllocation.cpp18
-rw-r--r--libs/rs/rsAllocation.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index cf394c0..2ed7774 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -202,6 +202,17 @@ void Allocation::uploadToTexture(const Context *rsc) {
rsc->checkError("Allocation::uploadToTexture");
}
+void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff,
+ uint32_t lod, RsAllocationCubemapFace face,
+ uint32_t w, uint32_t h) {
+ GLenum type = mType->getElement()->getComponent().getGLType();
+ GLenum format = mType->getElement()->getComponent().getGLFormat();
+ GLenum target = (GLenum)getGLTarget();
+ glBindTexture(target, mTextureID);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexSubImage2D(GL_TEXTURE_2D, lod, xoff, yoff, w, h, format, type, ptr);
+}
+
void Allocation::upload2DTexture(bool isFirstUpload, const void *ptr) {
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
@@ -368,12 +379,13 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod,
sendDirty();
mUploadDefered = true;
} else {
- upload2DTexture(false, data);
+ update2DTexture(data, xoff, yoff, lod, face, w, h);
}
}
-void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, RsAllocationCubemapFace face,
- uint32_t w, uint32_t h, uint32_t d, const void *data, uint32_t sizeBytes) {
+void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
+ uint32_t lod, RsAllocationCubemapFace face,
+ uint32_t w, uint32_t h, uint32_t d, const void *data, uint32_t sizeBytes) {
}
void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
diff --git a/libs/rs/rsAllocation.h b/libs/rs/rsAllocation.h
index a8d086e..a160765 100644
--- a/libs/rs/rsAllocation.h
+++ b/libs/rs/rsAllocation.h
@@ -106,6 +106,8 @@ public:
}
void upload2DTexture(bool isFirstUpload, const void *ptr);
+ void update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff,
+ uint32_t lod, RsAllocationCubemapFace face, uint32_t w, uint32_t h);
protected:
ObjectBaseRef<const Type> mType;