diff options
author | 2014-05-30 13:26:10 +0000 | |
---|---|---|
committer | 2014-05-30 13:26:10 +0000 | |
commit | a3264e53ee3f3c5d6a2c813df7e44b5b96d207f2 (patch) | |
tree | 5a95db31ba21ba5f0354b3e9e622a046fe6e04c4 /src/views/sdl/SkOSWindow_SDL.cpp | |
parent | 16fdbd3141f23a348e4b9f706e77307a947bd5a2 (diff) |
Revert "Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)"
This reverts commit eecaea4148805834f223681f70b6488ceba12d09.
R=robertphillips@google.com, scroggo@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/301283003
git-svn-id: http://skia.googlecode.com/svn/trunk@14989 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/views/sdl/SkOSWindow_SDL.cpp')
-rw-r--r-- | src/views/sdl/SkOSWindow_SDL.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/views/sdl/SkOSWindow_SDL.cpp b/src/views/sdl/SkOSWindow_SDL.cpp index 2a1fae28a6..27783d41fc 100644 --- a/src/views/sdl/SkOSWindow_SDL.cpp +++ b/src/views/sdl/SkOSWindow_SDL.cpp @@ -23,22 +23,23 @@ static void post_SkEvent_event() { } static bool skia_setBitmapFromSurface(SkBitmap* dst, SDL_Surface* src) { - SkBitmap::Config config; + SkColorType ct; + SkAlphaType at; switch (src->format->BytesPerPixel) { case 2: - config = SkBitmap::kRGB_565_Config; + ct = kRGB_565_SkColorType; + at = kOpaque_SkAlphaType; break; case 4: - config = SkBitmap::kARGB_8888_Config; + ct = kN32_SkColorType; + at = kPremul_SkAlphaType; break; default: return false; } - dst->setConfig(config, src->w, src->h, src->pitch); - dst->setPixels(src->pixels); - return true; + return dst->installPixels(SkImageInfo::Make(src->w, src->h, ct, at), src->pixels, src->pitch); } SkOSWindow::SkOSWindow(void* screen) { |