diff options
| author | Jason Sams <rjsams@android.com> | 2011-01-12 14:53:25 -0800 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2011-01-12 14:53:25 -0800 |
| commit | 236385b73f21ae65e756b9cb5738f1514d95ea3e (patch) | |
| tree | a822ea920bfa11fa3d87075c48b9a64360f65ec6 /rsAllocation.cpp | |
| parent | a23715148f7bda74e904fc553b70c9a49fd52a6e (diff) | |
Implement more of copy2DRange*
Change-Id: Id6be481c4abc968df27e5bba1ed044262ec0f293
Diffstat (limited to 'rsAllocation.cpp')
| -rw-r--r-- | rsAllocation.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/rsAllocation.cpp b/rsAllocation.cpp index cf394c0d..2ed77749 100644 --- a/rsAllocation.cpp +++ b/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, |
