Bug 39212 - Window object should have a CanvasPixelArray
Summary: Window object should have a CanvasPixelArray
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: HTML5
Depends on:
Blocks:
 
Reported: 2010-05-17 02:59 PDT by Andreas Kling
Modified: 2012-08-20 05:59 PDT (History)
8 users (show)

See Also:


Attachments
Proposed patch, first stab (20.18 KB, patch)
2010-05-17 03:59 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Proposed patch, first stab (20.18 KB, patch)
2010-05-17 04:03 PDT, Andreas Kling
oliver: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-05-17 02:59:40 PDT
Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#canvaspixelarray
Comment 1 Andreas Kling 2010-05-17 03:59:26 PDT
Created attachment 56233 [details]
Proposed patch, first stab
Comment 2 WebKit Review Bot 2010-05-17 04:01:51 PDT
Attachment 56233 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/bindings/js/JSCanvasPixelArrayCustom.cpp:27:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
Total errors found: 1 in 18 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andreas Kling 2010-05-17 04:03:41 PDT
Created attachment 56234 [details]
Proposed patch, first stab
Comment 4 Oliver Hunt 2010-05-17 15:32:03 PDT
Comment on attachment 56234 [details]
Proposed patch, first stab

This patch would destroy pixel array performance -- what is the bug you are seeing?
Comment 5 Oliver Hunt 2010-05-17 15:37:17 PDT
On the assumption that you're wanting to make a CPA instance claim to be an instanceof CanvasPixelArray you'll just want to make the logic that creates a CPA specify use the prototype from the CanvasPixelArray constructor, and set the constructor property on the CPA appropriately.

That said, you clearly are not testing performance of your change -- even the most rudimentary tests would have shown a huge (if memory serves ~5-10x) regression in read/write access to the cpa data.
Comment 6 Andreas Kling 2010-05-17 23:36:13 PDT
(In reply to comment #5)
> On the assumption that you're wanting to make a CPA instance claim to be an instanceof CanvasPixelArray you'll just want to make the logic that creates a CPA specify use the prototype from the CanvasPixelArray constructor, and set the constructor property on the CPA appropriately.

Your assumption is correct. I'll update the patch once I wrap my head around it.

> That said, you clearly are not testing performance of your change -- even the most rudimentary tests would have shown a huge (if memory serves ~5-10x) regression in read/write access to the cpa data.

Indeed true, this was merely a first (rather naive) shot at getting a "correct" implementation. :-)
Comment 7 Andreas Kling 2010-07-12 15:02:50 PDT
Right. The claim-to-be-a-CanvasPixelArray part is already covered by finagling in JSImageDataCustom.cpp

The missing thing is a CanvasPixelArray constructor on the window object.

Tests failing because of this:
- canvas/philip/tests/2d.imageData.create1.type.html
- canvas/philip/tests/2d.imageData.create2.type.html
- canvas/philip/tests/2d.imageData.get.type.html
Comment 8 Joshua Bell 2012-05-25 11:40:55 PDT
Some of these have recently started passing on chromium mac:

10.6 debug circa  http://trac.webkit.org/log/?verbose=on&rev=117893&stop_rev=117815 and http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk/src&mode=html&range=138206:138138

All mac variations circa http://trac.webkit.org/log/?verbose=on&rev=118542&stop_rev=118542 and http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk/src&mode=html&range=139078:139073

canvas/philip/tests/2d.imageData.create1.type.html,canvas/philip/tests/2d.imageData.create2.type.html,media/video-volume-slider.html,platform/chromium/virtual/gpu/canvas/philip/tests/2d.imageData.create1.type.html,platform/chromium/virtual/gpu/canvas/philip/tests/2d.imageData.create2.type.html
Comment 9 Joshua Bell 2012-05-25 11:43:02 PDT
Whoops, that passing test list should be:

canvas/philip/tests/2d.imageData.create1.type.html
canvas/philip/tests/2d.imageData.create2.type.html
platform/chromium/virtual/gpu/canvas/philip/tests/2d.imageData.create1.type.html
platform/chromium/virtual/gpu/canvas/philip/tests/2d.imageData.create2.type.html
Comment 10 Joshua Bell 2012-05-25 11:48:29 PDT
Ah, due to rebaseline from http://trac.webkit.org/changeset/117818/

That rebaseline is probably incorrect and should be removed.
Comment 11 Thiago Marcos P. Santos 2012-08-20 05:59:05 PDT
CanvasPixelArray is deprecated. Layout tests will be updated at bug 94474.