Removed unnecessary for loop 43/34043/1
authorPaul Wisbey <p.wisbey@samsung.com>
Tue, 20 Jan 2015 12:46:14 +0000 (12:46 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Tue, 20 Jan 2015 12:46:14 +0000 (12:46 +0000)
Change-Id: Iba497b5422dafdaa80a4d5e04cae73b2907cc434

dali/internal/render/gl-resources/bitmap-texture.cpp

index c001da8..408a319 100644 (file)
@@ -312,21 +312,10 @@ void BitmapTexture::Update( Integration::Bitmap* srcBitmap, std::size_t xOffset,
       mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 );
     }
 
-    const unsigned char* pixels = srcBitmap->GetBuffer();
-    unsigned int srcWidth = srcBitmap->GetImageWidth();
-    const unsigned int pixelDepth = Pixel::GetBytesPerPixel( mPixelFormat );
-
-    unsigned int yBottom = yOffset + srcBitmap->GetImageHeight();
-
-    for( unsigned int y = yOffset; y < yBottom; y++ )
-    {
-      mContext.TexSubImage2D( GL_TEXTURE_2D, 0,
-                              xOffset, y,
-                              srcWidth, 1,
-                              pixelFormat, pixelDataType, pixels );
-
-      pixels += srcWidth * pixelDepth;
-    }
+    mContext.TexSubImage2D( GL_TEXTURE_2D, 0,
+                            xOffset, yOffset,
+                            srcBitmap->GetImageWidth(), srcBitmap->GetImageHeight(),
+                            pixelFormat, pixelDataType, srcBitmap->GetBuffer() );
   }
 }