Bug 716415 - Update Azure for Skia API changes. r=gwright
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 19 Jan 2012 17:48:35 +1300
changeset 87307 e5131d25c42ceac0ffeeaa36dd3f5bcb721b874c
parent 87306 be5d69db8531cc80a74d8b907ed640feb0265e24
child 87308 47db1c632a61b78c7c11d91d466e28a9ee5892d6
push id674
push userffxbld
push dateTue, 13 Mar 2012 21:17:50 +0000
treeherdermozilla-beta@e3c4c92dec31 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgwright
bugs716415
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 716415 - Update Azure for Skia API changes. r=gwright
gfx/2d/SourceSurfaceSkia.cpp
--- a/gfx/2d/SourceSurfaceSkia.cpp
+++ b/gfx/2d/SourceSurfaceSkia.cpp
@@ -69,24 +69,24 @@ SourceSurfaceSkia::GetFormat() const
 }
 
 bool 
 SourceSurfaceSkia::InitFromData(unsigned char* aData,
                                 const IntSize &aSize,
                                 int32_t aStride,
                                 SurfaceFormat aFormat)
 {
-  mBitmap.setConfig(GfxFormatToSkiaConfig(aFormat), aSize.width, aSize.height, aStride);
-  if (!mBitmap.allocPixels()) {
+  SkBitmap temp;
+  temp.setConfig(GfxFormatToSkiaConfig(aFormat), aSize.width, aSize.height, aStride);
+  temp.setPixels(aData);
+
+  if (!temp.copyTo(&mBitmap, GfxFormatToSkiaConfig(aFormat))) {
     return false;
   }
   
-  if (!mBitmap.copyPixelsFrom(aData, mBitmap.getSafeSize(), aStride)) {
-    return false;
-  }
   mSize = aSize;
   mFormat = aFormat;
   mStride = aStride;
   return true;
 }
 
 bool
 SourceSurfaceSkia::InitWithBitmap(const SkBitmap& aBitmap,