diff options
| author | 2011-01-12 14:53:25 -0800 | |
|---|---|---|
| committer | 2011-01-12 14:53:25 -0800 | |
| commit | fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210 (patch) | |
| tree | 000fb80d2d73d062f9493cec84880974d77e68db /libs/rs/rsAllocation.cpp | |
| parent | f7086090cfc8d97b5bd3b4d7801a27af11f7c207 (diff) | |
Implement more of copy2DRange*
Change-Id: Id6be481c4abc968df27e5bba1ed044262ec0f293
Diffstat (limited to 'libs/rs/rsAllocation.cpp')
| -rw-r--r-- | libs/rs/rsAllocation.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index cf394c0dc1c7..2ed77749a311 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, |