Index: src/views/sdl/SkOSWindow_SDL.cpp |
diff --git a/src/views/sdl/SkOSWindow_SDL.cpp b/src/views/sdl/SkOSWindow_SDL.cpp |
index 27783d41fc736b6d346e5798a89a5ff82b0b51e3..2a1fae28a6efa10813003127cd6e607fd5769eb5 100644 |
--- a/src/views/sdl/SkOSWindow_SDL.cpp |
+++ b/src/views/sdl/SkOSWindow_SDL.cpp |
@@ -23,23 +23,22 @@ |
} |
static bool skia_setBitmapFromSurface(SkBitmap* dst, SDL_Surface* src) { |
- SkColorType ct; |
- SkAlphaType at; |
+ SkBitmap::Config config; |
switch (src->format->BytesPerPixel) { |
case 2: |
- ct = kRGB_565_SkColorType; |
- at = kOpaque_SkAlphaType; |
+ config = SkBitmap::kRGB_565_Config; |
break; |
case 4: |
- ct = kN32_SkColorType; |
- at = kPremul_SkAlphaType; |
+ config = SkBitmap::kARGB_8888_Config; |
break; |
default: |
return false; |
} |
- return dst->installPixels(SkImageInfo::Make(src->w, src->h, ct, at), src->pixels, src->pitch); |
+ dst->setConfig(config, src->w, src->h, src->pitch); |
+ dst->setPixels(src->pixels); |
+ return true; |
} |
SkOSWindow::SkOSWindow(void* screen) { |