Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: src/views/sdl/SkOSWindow_SDL.cpp

Issue 302053002: Revert of setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkPictureUtils.cpp ('k') | tests/BitmapCopyTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/utils/SkPictureUtils.cpp ('k') | tests/BitmapCopyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698