Bug 49957 - [Qt] screenIsMonochrome() is broken
Summary: [Qt] screenIsMonochrome() is broken
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Renata Hodovan
Keywords: Qt, QtTriaged
Depends on:
Reported: 2010-11-22 20:34 PST by Andreas Kling
Modified: 2010-12-15 13:00 PST (History)
1 user (show)

See Also:

Proposed patch (1.01 KB, patch)
2010-12-15 09:46 PST, Andreas Kling
no flags 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-11-22 20:34:40 PST
Our current implementation of screenIsMonochrome() checks if a QWidget's QPaintDevice::numColors() is < 2.
This is incorrect, for a monochrome device it will be == 2, since you get the number of possible colors, not the number of bits per color value.
Also, QPaintDevice::numColors() has been deprecated by QPaintDevice::colorCount()
Comment 1 Andreas Kling 2010-12-15 09:46:50 PST
Created attachment 76655 [details]
Proposed patch
Comment 2 Antonio Gomes 2010-12-15 12:00:58 PST
Comment on attachment 76655 [details]
Proposed patch

numcolor is deprecated ok, but why == instead of <? :)
Comment 3 WebKit Commit Bot 2010-12-15 13:00:32 PST
Comment on attachment 76655 [details]
Proposed patch

Clearing flags on attachment: 76655

Committed r74137: <http://trac.webkit.org/changeset/74137>
Comment 4 WebKit Commit Bot 2010-12-15 13:00:37 PST
All reviewed patches have been landed.  Closing bug.