- int bpp = Pixel::GetBytesPerPixel(textPixelFormat);
- unsigned int bufferSize = width * height * bpp;
- unsigned char* dstBuffer = static_cast<unsigned char*>(malloc(bufferSize));
- memcpy(dstBuffer, buffer + offsetPosition * bpp, bufferSize);
- PixelData pixelData = Dali::PixelData::New(dstBuffer,
- bufferSize,
- width,
- height,
- textPixelFormat,
- Dali::PixelData::FREE);
- return pixelData;
+ Texture texture = Texture::New(Dali::TextureType::TEXTURE_2D,
+ tilingInfo.textPixelFormat,
+ tilingInfo.width,
+ tilingInfo.height);
+ DevelTexture::UploadSubPixelData(texture, data, 0u, tilingInfo.offsetHeight, tilingInfo.width, tilingInfo.height);
+
+ textureSet.SetTexture(textureSetIndex, texture);
+ textureSet.SetSampler(textureSetIndex, sampler);