Bug 73645 - Philip canvas tests fail with non unity device scale factor
Summary: Philip canvas tests fail with non unity device scale factor
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 83072
Blocks: 68075
  Show dependency treegraph
 
Reported: 2011-12-02 04:21 PST by John Knottenbelt
Modified: 2012-04-03 14:48 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Knottenbelt 2011-12-02 04:21:50 PST
I've tested this on Chromium's DRT, but I should think that this will apply to all ports that set the page's deviceScaleFactor to a value other than 1.0

To reproduce in Chromium DRT, add a call to view->setDeviceScaleFactor(2.0); in TestShell::createNewWindow()

Expected to fail, but passed: (5)
  canvas/philip/tests/2d.line.width.basic.html
  canvas/philip/tests/2d.line.width.transformed.html
  canvas/philip/tests/2d.path.arcTo.shape.curve1.html
  canvas/philip/tests/2d.transformation.setTransform.skewed.html
  canvas/philip/tests/2d.transformation.transform.skewed.html

Regressions: Unexpected text diff mismatch : (41)
  canvas/philip/tests/2d.fillRect.shadow.html = TEXT
  canvas/philip/tests/2d.imageData.get.unaffected.html = TEXT
  canvas/philip/tests/2d.imageData.put.dirty.negative.html = TEXT
  canvas/philip/tests/2d.imageData.put.dirty.rect1.html = TEXT
  canvas/philip/tests/2d.imageData.put.dirty.rect2.html = TEXT
  canvas/philip/tests/2d.imageData.put.modified.html = TEXT
  canvas/philip/tests/2d.line.cap.round.html = TEXT
  canvas/philip/tests/2d.line.join.bevel.html = TEXT
  canvas/philip/tests/2d.line.join.round.html = TEXT
  canvas/philip/tests/2d.pattern.paint.orientation.canvas.html = TEXT
  canvas/philip/tests/2d.shadow.alpha.2.html = TEXT
  canvas/philip/tests/2d.shadow.alpha.3.html = TEXT
  canvas/philip/tests/2d.shadow.alpha.4.html = TEXT
  canvas/philip/tests/2d.shadow.alpha.5.html = TEXT
  canvas/philip/tests/2d.shadow.canvas.alpha.html = TEXT
  canvas/philip/tests/2d.shadow.canvas.basic.html = TEXT
  canvas/philip/tests/2d.shadow.canvas.transparent.2.html = TEXT
  canvas/philip/tests/2d.shadow.clip.1.html = TEXT
  canvas/philip/tests/2d.shadow.clip.3.html = TEXT
  canvas/philip/tests/2d.shadow.gradient.alpha.html = TEXT
  canvas/philip/tests/2d.shadow.gradient.basic.html = TEXT
  canvas/philip/tests/2d.shadow.gradient.transparent.2.html = TEXT
  canvas/philip/tests/2d.shadow.image.alpha.html = TEXT
  canvas/philip/tests/2d.shadow.image.basic.html = TEXT
  canvas/philip/tests/2d.shadow.image.scale.html = TEXT
  canvas/philip/tests/2d.shadow.image.transparent.2.html = TEXT
  canvas/philip/tests/2d.shadow.offset.negativeY.html = TEXT
  canvas/philip/tests/2d.shadow.offset.positiveX.html = TEXT
  canvas/philip/tests/2d.shadow.outside.html = TEXT
  canvas/philip/tests/2d.shadow.pattern.alpha.html = TEXT
  canvas/philip/tests/2d.shadow.pattern.basic.html = TEXT
  canvas/philip/tests/2d.shadow.pattern.transparent.2.html = TEXT
  canvas/philip/tests/2d.shadow.stroke.basic.html = TEXT
  canvas/philip/tests/2d.shadow.stroke.cap.2.html = TEXT
  canvas/philip/tests/2d.shadow.stroke.join.2.html = TEXT
  canvas/philip/tests/2d.shadow.transform.1.html = TEXT
  canvas/philip/tests/2d.shadow.transform.2.html = TEXT
  canvas/philip/tests/2d.strokeRect.shadow.html = TEXT
  canvas/philip/tests/toDataURL.jpeg.primarycolours.html = TEXT
  canvas/philip/tests/toDataURL.png.complexcolours.html = TEXT
  canvas/philip/tests/toDataURL.png.primarycolours.html = TEXT
Comment 1 John Knottenbelt 2011-12-02 04:25:10 PST
One problem is that I think that the tests were written with an assumption of a 1:1 correspondence between canvas dimensions and the backing image data dimensions. 

Related bugs:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15041 and
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15042

However, this won't account for all the failures.
Comment 2 Matthew Delaney 2012-02-22 10:27:05 PST
You're correct, just about every one of our canvas layout tests (including philip's) wasn't written with this behavior in mind. By this behavior, I mean specifically the decision to automatically scale up the backing store and then give all those bits via getImageData and friends. On the same note, this behavior breaks a lot of webpages that use get/putImageData and toDataURL without accounting for the increased backing store.

Even if the way the tests sample the canvas took this behavior into account, there would still be additional side effects from this behavior that our layout tests don't account for such as rounding differences due to the increased scale.

A large number of tests currently pass largely due to the fact that the pixels that they're actually checking happen to have the same values (e.g. a whole section of the canvas is green, so sampling the device pixel at x or 2x will likely hit green in both cases).