summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-07 20:34:47 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-07 20:34:47 +0000
commita4c094ab04b6a30404eea4a914cbb01f45866f17 (patch)
tree55195f308c11ec91e4d84b5e49d70eaeddde8ff6
parent7f38fdafdc6d48e97c5bd81b65671af7b4f2fe0b (diff)
downloadchromium_src-a4c094ab04b6a30404eea4a914cbb01f45866f17.zip
chromium_src-a4c094ab04b6a30404eea4a914cbb01f45866f17.tar.gz
chromium_src-a4c094ab04b6a30404eea4a914cbb01f45866f17.tar.bz2
Allow GrabWindowSnapshot() to fail when libpng fails.
BUG=280195 R=sky@chromium.org, kinaba@chromium.org TEST=None Review URL: https://codereview.chromium.org/59073011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233678 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/snapshot/snapshot_aura.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/snapshot/snapshot_aura.cc b/ui/snapshot/snapshot_aura.cc
index ea4cb1b..1cebfe9 100644
--- a/ui/snapshot/snapshot_aura.cc
+++ b/ui/snapshot/snapshot_aura.cc
@@ -79,12 +79,12 @@ bool GrabWindowSnapshot(gfx::NativeWindow window,
unsigned char* pixels = reinterpret_cast<unsigned char*>(
bitmap.pixelRef()->pixels());
- gfx::PNGCodec::Encode(pixels, gfx::PNGCodec::FORMAT_BGRA,
- gfx::Size(bitmap.width(), bitmap.height()),
- base::checked_numeric_cast<int>(bitmap.rowBytes()),
- true, std::vector<gfx::PNGCodec::Comment>(),
- png_representation);
- return true;
+ return gfx::PNGCodec::Encode(
+ pixels, gfx::PNGCodec::FORMAT_BGRA,
+ gfx::Size(bitmap.width(), bitmap.height()),
+ base::checked_numeric_cast<int>(bitmap.rowBytes()),
+ true, std::vector<gfx::PNGCodec::Comment>(),
+ png_representation);
}
} // namespace ui