Code refactor: move more memory allocation logic into device API.
[blender.git] / intern / cycles / device / device.cpp
index 9de10c184fb60409cb4778e8220b6626d03966a4..41fbe7ce81bc92ce711fdb0874db2bdf092069cb 100644 (file)
@@ -85,28 +85,12 @@ Device::~Device()
        }
 }
 
-void Device::pixels_alloc(device_memory& mem)
-{
-       mem_alloc(mem);
-}
-
-void Device::pixels_copy_from(device_memory& mem, int y, int w, int h)
-{
-       if(mem.data_type == TYPE_HALF)
-               mem_copy_from(mem, y, w, h, sizeof(half4));
-       else
-               mem_copy_from(mem, y, w, h, sizeof(uchar4));
-}
-
-void Device::pixels_free(device_memory& mem)
-{
-       mem_free(mem);
-}
-
 void Device::draw_pixels(device_memory& rgba, int y, int w, int h, int dx, int dy, int width, int height, bool transparent,
        const DeviceDrawParams &draw_params)
 {
-       pixels_copy_from(rgba, y, w, h);
+       assert(mem.type == MEM_PIXELS);
+
+       mem_copy_from(rgba, y, w, h, rgba.memory_elements_size(1));
 
        if(transparent) {
                glEnable(GL_BLEND);