summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 20:45:54 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 20:45:54 +0000
commit8c373ff16ce620316116327790d25fe3623c81e3 (patch)
tree272a376884cb650289a22da331dfaba6e6328f87
parent041a6e09b0de89118267ba308caff2a191f08ea6 (diff)
downloadchromium_src-8c373ff16ce620316116327790d25fe3623c81e3.zip
chromium_src-8c373ff16ce620316116327790d25fe3623c81e3.tar.gz
chromium_src-8c373ff16ce620316116327790d25fe3623c81e3.tar.bz2
Fixes two bugs leading to a layout test failure:
. Our Document.idl was not up to date. This resulted in an error when the JavaScript tried to execute a function on Document. . Our code to write a SkBitmap to a BMP was writing colors premultiplied. It shouldn't do that. BUG=2973 TEST=layout test fix Review URL: http://codereview.chromium.org/6348 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3043 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.checksum1
-rw-r--r--webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.pngbin0 -> 3232 bytes
-rw-r--r--webkit/port/dom/Document.idl5
-rw-r--r--webkit/port/platform/graphics/SkiaUtils.cpp12
-rw-r--r--webkit/tools/layout_tests/test_lists/tests_fixable.txt4
5 files changed, 17 insertions, 5 deletions
diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.checksum b/webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.checksum
new file mode 100644
index 0000000..9b52c8f
--- /dev/null
+++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.checksum
@@ -0,0 +1 @@
+b3847e84948f400e39ae822687097ca8 \ No newline at end of file
diff --git a/webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.png b/webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.png
new file mode 100644
index 0000000..5023ea9
--- /dev/null
+++ b/webkit/data/layout_test_results/v8/LayoutTests/fast/canvas/canvas-bg-expected.png
Binary files differ
diff --git a/webkit/port/dom/Document.idl b/webkit/port/dom/Document.idl
index fa05924..0d3077d 100644
--- a/webkit/port/dom/Document.idl
+++ b/webkit/port/dom/Document.idl
@@ -225,6 +225,11 @@ module core {
in DOMString pseudoElement,
in [Optional] boolean authorOnly);
#endif
+#if !defined(LANGUAGE_COM)
+#if !defined(LANGUAGE_OBJECTIVE_C)
+ CanvasRenderingContext2D getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
+#endif
+#endif
// HTML 5
NodeList getElementsByClassName(in DOMString tagname);
diff --git a/webkit/port/platform/graphics/SkiaUtils.cpp b/webkit/port/platform/graphics/SkiaUtils.cpp
index e0e419f..4e1e5b5 100644
--- a/webkit/port/platform/graphics/SkiaUtils.cpp
+++ b/webkit/port/platform/graphics/SkiaUtils.cpp
@@ -267,8 +267,18 @@ PassRefPtr<WebCore::SharedBuffer> SerializeSkBitmap(const SkBitmap& bitmap)
// Write the image body.
SkAutoLockPixels bitmap_lock(bitmap);
- buffer->append(reinterpret_cast<const char*>(bitmap.getAddr32(0, 0)),
+ unsigned header_size = buffer->size();
+ const uint32_t* src_image_data = bitmap.getAddr32(0, 0);
+ buffer->append(reinterpret_cast<const char*>(src_image_data),
v4Header.bV4SizeImage);
+ uint32_t* dest_image_data =
+ reinterpret_cast<uint32_t*>(const_cast<char*>(buffer->data()) +
+ header_size);
+
+ // Skia stores colors pre-multiplied, BMP doesn't. Need to convert the
+ // colors.
+ for (int i = width * height - 1; i >= 0; --i)
+ dest_image_data[i] = SkPMColorToColor(src_image_data[i]);
return buffer;
}
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt
index 73f8621..8d01efe 100644
--- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt
+++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt
@@ -845,10 +845,6 @@ V8 | KJS # LayoutTests/fast/canvas/canvas-longlived-context.html = FAIL
V8 | KJS # LayoutTests/fast/canvas/canvas-path-with-inf-nan-dimensions.html = FAIL
V8 | KJS # LayoutTests/fast/canvas/canvas-save-restore-with-path.html = FAIL
-# Incorrect rendering - the pattern does not appear (unknown why).
-# http://code.google.com/p/chromium/issues/detail?id=2973
-V8 | KJS # LayoutTests/fast/canvas/canvas-bg.html = FAIL
-
# We don't implement toDataURL.
# http://code.google.com/p/chromium/issues/detail?id=2972
V8 | KJS # LayoutTests/fast/canvas/toDataURL-noData.html = FAIL