diff options
author | Mike Reed <reed@google.com> | 2014-06-16 17:31:48 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2014-06-20 10:28:37 -0400 |
commit | b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a (patch) | |
tree | 7d68b96a6fd02ca6ece664d5c53ee9778ef49d17 /cmds | |
parent | 9285d1bf9c57e5f1da8f8d8ef7a6a38b2f0e4ec3 (diff) | |
download | frameworks_base-b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a.zip frameworks_base-b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a.tar.gz frameworks_base-b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a.tar.bz2 |
stop using (deprecated) SkBitmap::Config
Change-Id: Ic75b5fc6996578e9d95bd3a220439ec1541d7c3b
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/screencap/screencap.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cmds/screencap/screencap.cpp b/cmds/screencap/screencap.cpp index 6296dd1..6b2a0e2 100644 --- a/cmds/screencap/screencap.cpp +++ b/cmds/screencap/screencap.cpp @@ -52,13 +52,13 @@ static void usage(const char* pname) ); } -static SkBitmap::Config flinger2skia(PixelFormat f) +static SkColorType flinger2skia(PixelFormat f) { switch (f) { case PIXEL_FORMAT_RGB_565: - return SkBitmap::kRGB_565_Config; + return kRGB_565_SkColorType; default: - return SkBitmap::kARGB_8888_Config; + return kN32_SkColorType; } } @@ -174,9 +174,10 @@ int main(int argc, char** argv) if (base) { if (png) { + const SkImageInfo info = SkImageInfo::Make(w, h, flinger2skia(f), + kPremul_SkAlphaType); SkBitmap b; - b.setConfig(flinger2skia(f), w, h, s*bytesPerPixel(f)); - b.setPixels((void*)base); + b.installPixels(info, const_cast<void*>(base), s*bytesPerPixel(f)); SkDynamicMemoryWStream stream; SkImageEncoder::EncodeStream(&stream, b, SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality); |