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

Unified Diff: webkit/tools/test_shell/test_shell.cc

Issue 21201: Transparency (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « webkit/glue/webframe_impl.cc ('k') | webkit/tools/test_shell/test_shell_tests.vcproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell.cc
===================================================================
--- webkit/tools/test_shell/test_shell.cc (revision 10202)
+++ webkit/tools/test_shell/test_shell.cc (working copy)
@@ -248,12 +248,18 @@
std::vector<unsigned char> png;
SkAutoLockPixels src_bmp_lock(src_bmp);
PNGEncoder::ColorFormat color_format = PNGEncoder::FORMAT_BGRA;
-#if defined(OS_WIN) || defined(OS_LINUX)
+
+ // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want
+ // to keep it. On Windows, the alpha channel is wrong since text/form control
+ // drawing may have erased it in a few places. So on Windows we force it to
+ // opaque and also don't write the alpha channel for the reference. Linux
+ // doesn't have the wrong alpha like Windows, but we ignore it anyway.
+#if defined(OS_WIN)
bool discard_transparency = true;
+ device->makeOpaque(0, 0, src_bmp.width(), src_bmp.height());
+#elif defined(OS_LINUX)
+ bool discard_transparency = true;
#elif defined(OS_MACOSX)
- // the expected PNGs in webkit have an alpha channel. We shouldn't discard
- // the transparency for reference purposes, though the hashes will still
- // match.
bool discard_transparency = false;
#endif
PNGEncoder::Encode(
« no previous file with comments | « webkit/glue/webframe_impl.cc ('k') | webkit/tools/test_shell/test_shell_tests.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698