summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xskia/ext/bitmap_platform_device_mac.cc7
-rw-r--r--webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj8
-rw-r--r--webkit/tools/test_shell/resources/README.txt2
-rw-r--r--webkit/tools/test_shell/resources/missingImage.pngbin0 -> 411 bytes
-rw-r--r--webkit/tools/test_shell/test_shell.cc15
5 files changed, 22 insertions, 10 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index b338c9f..f544684 100755
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -169,10 +169,13 @@ BitmapPlatformDeviceMac* BitmapPlatformDeviceMac::Create(CGContextRef context,
CGColorSpaceRef color_space =
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
- // allocate a bitmap context with 4 components per pixel (RGBA):
+ // allocate a bitmap context with 4 components per pixel (BGRA). Apple
+ // recommends these flags for improved CG performance.
CGContextRef bitmap_context =
CGBitmapContextCreate(data, width, height, 8, width*4,
- color_space, kCGImageAlphaPremultipliedLast);
+ color_space,
+ kCGImageAlphaPremultipliedFirst |
+ kCGBitmapByteOrder32Host);
// Change the coordinate system to match WebCore's
CGContextTranslateCTM(bitmap_context, 0, height);
diff --git a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
index 01f2dde..01cd42c 100644
--- a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
+++ b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
@@ -143,7 +143,7 @@
E4506BDE0EF03310003BE099 /* resource_fetcher_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4506BDD0EF03310003BE099 /* resource_fetcher_unittest.cc */; };
E4506BE00EF03318003BE099 /* webframe_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4506BDF0EF03318003BE099 /* webframe_unittest.cc */; };
E4506C4A0EF04007003BE099 /* node_leak_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB8A78540DC553BC005C27B8 /* node_leak_test.cc */; };
- E45074150EFBFEFF003BE099 /* missingImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = E45074140EFBFEFF003BE099 /* missingImage.gif */; };
+ E45074150EFBFEFF003BE099 /* missingImage.png in Resources */ = {isa = PBXBuildFile; fileRef = E45074140EFBFEFF003BE099 /* missingImage.png */; };
E45449370EC9FD15000DFA6E /* test_shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = E45449360EC9FD15000DFA6E /* test_shell.cc */; };
E45628E70E26B4FE005E4685 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
E45628E80E26B4FE005E4685 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
@@ -813,7 +813,7 @@
E4506BDB0EF03307003BE099 /* regular_expression_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = regular_expression_unittest.cc; sourceTree = "<group>"; };
E4506BDD0EF03310003BE099 /* resource_fetcher_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resource_fetcher_unittest.cc; sourceTree = "<group>"; };
E4506BDF0EF03318003BE099 /* webframe_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = webframe_unittest.cc; sourceTree = "<group>"; };
- E45074140EFBFEFF003BE099 /* missingImage.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = missingImage.gif; path = ../resources/missingImage.gif; sourceTree = SOURCE_ROOT; };
+ E45074140EFBFEFF003BE099 /* missingImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = missingImage.png; sourceTree = "<group>"; };
E45449360EC9FD15000DFA6E /* test_shell.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_shell.cc; sourceTree = "<group>"; };
E456293E0E26B4FE005E4685 /* TestShell.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestShell.app; sourceTree = BUILT_PRODUCTS_DIR; };
E45629460E26B5A7005E4685 /* net.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = net.xcodeproj; path = net/net.xcodeproj; sourceTree = "<group>"; };
@@ -1174,7 +1174,7 @@
8287BE000E0AA28000CC8F2F /* eastWestResizeCursor.png */,
8287BE010E0AA28000CC8F2F /* helpCursor.png */,
8287BE020E0AA28000CC8F2F /* linkCursor.png */,
- E45074140EFBFEFF003BE099 /* missingImage.gif */,
+ E45074140EFBFEFF003BE099 /* missingImage.png */,
8287BE030E0AA28000CC8F2F /* moveCursor.png */,
8287BE040E0AA28000CC8F2F /* noDropCursor.png */,
8287BE050E0AA28000CC8F2F /* noneCursor.png */,
@@ -1763,7 +1763,7 @@
E45628F40E26B4FE005E4685 /* eastWestResizeCursor.png in Resources */,
E45628F50E26B4FE005E4685 /* helpCursor.png in Resources */,
E45628F60E26B4FE005E4685 /* linkCursor.png in Resources */,
- E45074150EFBFEFF003BE099 /* missingImage.gif in Resources */,
+ E45074150EFBFEFF003BE099 /* missingImage.png in Resources */,
E45628F70E26B4FE005E4685 /* moveCursor.png in Resources */,
E45628F80E26B4FE005E4685 /* noDropCursor.png in Resources */,
E45628F90E26B4FE005E4685 /* noneCursor.png in Resources */,
diff --git a/webkit/tools/test_shell/resources/README.txt b/webkit/tools/test_shell/resources/README.txt
index c227a5d..4a4e10b 100644
--- a/webkit/tools/test_shell/resources/README.txt
+++ b/webkit/tools/test_shell/resources/README.txt
@@ -22,3 +22,5 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+missingImage.png is the same as WebCore/Resources/missingImage.png and carries exactly the same license.
diff --git a/webkit/tools/test_shell/resources/missingImage.png b/webkit/tools/test_shell/resources/missingImage.png
new file mode 100644
index 0000000..5c24d20
--- /dev/null
+++ b/webkit/tools/test_shell/resources/missingImage.png
Binary files differ
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index b31abee..39c5121 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -197,14 +197,14 @@ std::string TestShell::DumpImage(WebFrame* web_frame,
// Encode image.
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)
bool discard_transparency = true;
- PNGEncoder::ColorFormat color_format = PNGEncoder::FORMAT_BGRA;
#elif defined(OS_MACOSX)
- // the expected PNGs in webkit have an alpha channel. We must not discard
- // the transparency else the checksums won't match.
+ // 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;
- PNGEncoder::ColorFormat color_format = PNGEncoder::FORMAT_RGBA;
#endif
PNGEncoder::Encode(
reinterpret_cast<const unsigned char*>(src_bmp.getPixels()),
@@ -497,7 +497,14 @@ std::string GetDataResource(int resource_id) {
static std::string broken_image_data;
if (broken_image_data.empty()) {
FilePath path = GetResourcesFilePath();
+#if defined(OS_WIN) || defined(OS_LINUX)
path = path.Append(FILE_PATH_LITERAL("missingImage.gif"));
+#elif defined(OS_MACOSX)
+ // In order to match WebKit's colors for the missing image, we have to
+ // use a PNG. The GIF doesn't have the color range needed to correctly
+ // match the TIFF they use in Safari.
+ path = path.Append(FILE_PATH_LITERAL("missingImage.png"));
+#endif
bool success = file_util::ReadFileToString(path.ToWStringHack(),
&broken_image_data);
if (!success) {