Title: [224283] trunk
- Revision
- 224283
- Author
- d...@apple.com
- Date
- 2017-11-01 11:43:57 -0700 (Wed, 01 Nov 2017)
Log Message
transferFromImageBitmap should update canvas dimensions
https://bugs.webkit.org/show_bug.cgi?id=179096
<rdar://problem/35285218>
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
Update expected results now that we pass more of this test.
* web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt:
Source/WebCore:
When transferFromImageBitmap is called, the dimensions of the HTMLCanvasElement
should be updated to reflect the size of the passed ImageBitmap.
Update an existing WPT result.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::setImageBuffer const): Update the
size of the element based on the incoming buffer.
* html/HTMLCanvasElement.h: Mark m_size as mutable so we can
call it from the const function setImageBuffer.
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (224282 => 224283)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2017-11-01 18:25:40 UTC (rev 224282)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2017-11-01 18:43:57 UTC (rev 224283)
@@ -1,3 +1,15 @@
+2017-10-31 Dean Jackson <d...@apple.com>
+
+ transferFromImageBitmap should update canvas dimensions
+ https://bugs.webkit.org/show_bug.cgi?id=179096
+ <rdar://problem/35285218>
+
+ Reviewed by Sam Weinig.
+
+ Update expected results now that we pass more of this test.
+
+ * web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt:
+
2017-10-31 Chris Dumez <cdu...@apple.com>
Fix a couple of service worker tests and unskip them
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt (224282 => 224283)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt 2017-11-01 18:25:40 UTC (rev 224282)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt 2017-11-01 18:43:57 UTC (rev 224283)
@@ -1,5 +1,5 @@
-FAIL Test that createImageBitmap from a bitmaprenderer canvas produces correct result assert_equals: expected 10 but got 20
+PASS Test that createImageBitmap from a bitmaprenderer canvas produces correct result
PASS Test that createImageBitmap on a bitmaprenderer canvas that never consumes any source produces correct result
PASS Test that createImageBitmap on a bitmaprenderer canvas that consumes null produces correct result
Modified: trunk/Source/WebCore/ChangeLog (224282 => 224283)
--- trunk/Source/WebCore/ChangeLog 2017-11-01 18:25:40 UTC (rev 224282)
+++ trunk/Source/WebCore/ChangeLog 2017-11-01 18:43:57 UTC (rev 224283)
@@ -1,3 +1,22 @@
+2017-10-31 Dean Jackson <d...@apple.com>
+
+ transferFromImageBitmap should update canvas dimensions
+ https://bugs.webkit.org/show_bug.cgi?id=179096
+ <rdar://problem/35285218>
+
+ Reviewed by Sam Weinig.
+
+ When transferFromImageBitmap is called, the dimensions of the HTMLCanvasElement
+ should be updated to reflect the size of the passed ImageBitmap.
+
+ Update an existing WPT result.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::setImageBuffer const): Update the
+ size of the element based on the incoming buffer.
+ * html/HTMLCanvasElement.h: Mark m_size as mutable so we can
+ call it from the const function setImageBuffer.
+
2017-11-01 Yusuke Suzuki <utatane....@gmail.com>
[JSC] Introduce @toObject
Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (224282 => 224283)
--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2017-11-01 18:25:40 UTC (rev 224282)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2017-11-01 18:43:57 UTC (rev 224283)
@@ -978,6 +978,9 @@
m_imageBuffer = WTFMove(buffer);
}
+ if (m_imageBuffer && m_size != m_imageBuffer->internalSize())
+ m_size = m_imageBuffer->internalSize();
+
size_t currentMemoryCost = memoryCost();
activePixelMemory += currentMemoryCost;
Modified: trunk/Source/WebCore/html/HTMLCanvasElement.h (224282 => 224283)
--- trunk/Source/WebCore/html/HTMLCanvasElement.h 2017-11-01 18:25:40 UTC (rev 224282)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.h 2017-11-01 18:43:57 UTC (rev 224283)
@@ -200,7 +200,7 @@
std::unique_ptr<CanvasRenderingContext> m_context;
FloatRect m_dirtyRect;
- IntSize m_size;
+ mutable IntSize m_size;
bool m_originClean { true };
bool m_ignoreReset { false };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes