| OLD | NEW | 
|    1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 
|    2 // Use of this source code is governed by a BSD-style license that can be |    2 // Use of this source code is governed by a BSD-style license that can be | 
|    3 // found in the LICENSE file. |    3 // found in the LICENSE file. | 
|    4  |    4  | 
|    5 #undef LOG |    5 #undef LOG | 
|    6  |    6  | 
|    7 #include "webkit/tools/test_shell/test_shell.h" |    7 #include "webkit/tools/test_shell/test_shell.h" | 
|    8  |    8  | 
|    9 #include "app/gfx/codec/png_codec.h" |    9 #include "app/gfx/codec/png_codec.h" | 
|   10 #include "base/base_paths.h" |   10 #include "base/base_paths.h" | 
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  293   gfx::PNGCodec::ColorFormat color_format = gfx::PNGCodec::FORMAT_BGRA; |  293   gfx::PNGCodec::ColorFormat color_format = gfx::PNGCodec::FORMAT_BGRA; | 
|  294  |  294  | 
|  295   // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want |  295   // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want | 
|  296   // to keep it. On Windows, the alpha channel is wrong since text/form control |  296   // to keep it. On Windows, the alpha channel is wrong since text/form control | 
|  297   // drawing may have erased it in a few places. So on Windows we force it to |  297   // drawing may have erased it in a few places. So on Windows we force it to | 
|  298   // opaque and also don't write the alpha channel for the reference. Linux |  298   // opaque and also don't write the alpha channel for the reference. Linux | 
|  299   // doesn't have the wrong alpha like Windows, but we ignore it anyway. |  299   // doesn't have the wrong alpha like Windows, but we ignore it anyway. | 
|  300 #if defined(OS_WIN) |  300 #if defined(OS_WIN) | 
|  301   bool discard_transparency = true; |  301   bool discard_transparency = true; | 
|  302   device.makeOpaque(0, 0, src_bmp.width(), src_bmp.height()); |  302   device.makeOpaque(0, 0, src_bmp.width(), src_bmp.height()); | 
|  303 #elif defined(OS_LINUX) |  | 
|  304   bool discard_transparency = true; |  | 
|  305 #elif defined(OS_MACOSX) |  303 #elif defined(OS_MACOSX) | 
|  306   bool discard_transparency = false; |  304   bool discard_transparency = false; | 
 |  305 #elif defined(OS_POSIX) | 
 |  306   bool discard_transparency = true; | 
|  307 #endif |  307 #endif | 
|  308  |  308  | 
|  309   // Compute MD5 sum.  We should have done this before calling |  309   // Compute MD5 sum.  We should have done this before calling | 
|  310   // device.makeOpaque on Windows.  Because we do it after the call, there are |  310   // device.makeOpaque on Windows.  Because we do it after the call, there are | 
|  311   // some images that are the pixel identical on windows and other platforms |  311   // some images that are the pixel identical on windows and other platforms | 
|  312   // but have different MD5 sums.  At this point, rebaselining all the windows |  312   // but have different MD5 sums.  At this point, rebaselining all the windows | 
|  313   // tests is too much of a pain, so we just check in different baselines. |  313   // tests is too much of a pain, so we just check in different baselines. | 
|  314   MD5Context ctx; |  314   MD5Context ctx; | 
|  315   MD5Init(&ctx); |  315   MD5Init(&ctx); | 
|  316   MD5Update(&ctx, src_bmp.getPixels(), src_bmp.getSize()); |  316   MD5Update(&ctx, src_bmp.getPixels(), src_bmp.getSize()); | 
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  755  |  755  | 
|  756 void CloseIdleConnections() { |  756 void CloseIdleConnections() { | 
|  757   // Used in benchmarking,  Ignored for test_shell. |  757   // Used in benchmarking,  Ignored for test_shell. | 
|  758 } |  758 } | 
|  759  |  759  | 
|  760 void SetCacheMode(bool enabled) { |  760 void SetCacheMode(bool enabled) { | 
|  761   // Used in benchmarking,  Ignored for test_shell. |  761   // Used in benchmarking,  Ignored for test_shell. | 
|  762 } |  762 } | 
|  763  |  763  | 
|  764 }  // namespace webkit_glue |  764 }  // namespace webkit_glue | 
| OLD | NEW |