Bug 99417 - [chromium/mac] Make spelling indicator HighDPI
Summary: [chromium/mac] Make spelling indicator HighDPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nico Weber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 22:52 PDT by Nico Weber
Modified: 2012-10-16 12:04 PDT (History)
3 users (show)

See Also:


Attachments
Patch (8.85 KB, patch)
2012-10-15 22:53 PDT, Nico Weber
no flags Details | Formatted Diff | Diff
Patch (113.39 KB, patch)
2012-10-16 11:05 PDT, Nico Weber
no flags Details | Formatted Diff | Diff
Patch (113.39 KB, patch)
2012-10-16 11:12 PDT, Nico Weber
no flags Details | Formatted Diff | Diff
Patch (113.87 KB, patch)
2012-10-16 11:32 PDT, Nico Weber
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2012-10-15 22:52:10 PDT
[chromium/mac] Make spelling indicator HighDPI
Comment 1 Nico Weber 2012-10-15 22:53:26 PDT
Created attachment 168856 [details]
Patch
Comment 2 Rik Cabanier 2012-10-15 22:57:53 PDT
Attachment 168856 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:643:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:645:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Nico Weber 2012-10-15 22:58:19 PDT
Note that this patch is much simpler than it looks. It does the following things:

1. Undo the forking of the function code done in the patch linked in the changelog.
2. Just add the else block that contains the comment "            // Pattern: a b c c b a"

This probably needs new baselines too (i.e. this isn't the final patch, but the code should be final); I'll look into that tomorrow. See http://crbug.com/156022 for where the color values come from.
Comment 4 Nico Weber 2012-10-16 11:05:30 PDT
Created attachment 168979 [details]
Patch
Comment 5 WebKit Review Bot 2012-10-16 11:09:25 PDT
Attachment 168979 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:643:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:645:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Nico Weber 2012-10-16 11:12:04 PDT
Created attachment 168982 [details]
Patch
Comment 7 WebKit Review Bot 2012-10-16 11:19:38 PDT
Attachment 168982 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:643:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:645:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Stephen White 2012-10-16 11:25:20 PDT
Comment on attachment 168982 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168982&action=review

Fix the ChangeLog, satisfy the bots, the rest is at your discretion.

> Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:604
> +    ASSERT(deviceScaleFactor > 0);

Maybe this could be ASSERT(deviceScaleFactor == 1 || deviceScaleFactor == 2) (see below).

> Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:640
> +        } else {

Maybe:

} else if (deviceScaleFactor == 2) {
 ... 
} else {
  ASSERT_NOT_REACHED();
}

That way, if we ever try to support some future DPI, we can find the problems quickly.

> Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:663
> +            // Pattern: a b c c b a
> +            //          d e f f e d
> +            //          g h j j h g
> +            //          k l m m l k
> +            //          n o p p o n
> +            //          q r s s r q
> +            for (int x = 0; x < colPixels; ++x) {
> +                uint32_t* row = misspellBitmap[index]->getAddr32(0, x);
> +                row[0] = colors[index][x * 3];
> +                row[1] = colors[index][x * 3 + 1];
> +                row[2] = colors[index][x * 3 + 2];
> +                row[3] = colors[index][x * 3 + 2];
> +                row[4] = colors[index][x * 3 + 1];
> +                row[5] = colors[index][x * 3];
> +                row[6] = transparentColor;
> +                row[7] = transparentColor;

Nit:  this looks like

a b c c b a
d e f f e d
g h j j h g
g h j j h g
d e f f e d
a b c c b a

to me.
Comment 9 Nico Weber 2012-10-16 11:32:30 PDT
Created attachment 168986 [details]
Patch
Comment 10 Nico Weber 2012-10-16 11:33:41 PDT
(In reply to comment #8)
> (From update of attachment 168982 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=168982&action=review
> 
> Fix the ChangeLog,

Done.

> satisfy the bots

I think the style bot is wrong here; the pixels would look strange with a 4 indent (not aligned with the previous line)

> 
> > Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:604
> > +    ASSERT(deviceScaleFactor > 0);
> 
> Maybe this could be ASSERT(deviceScaleFactor == 1 || deviceScaleFactor == 2) (see below).

Done.

> 
> > Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:640
> > +        } else {
> 
> Maybe:
> 
> } else if (deviceScaleFactor == 2) {
>  ... 
> } else {
>   ASSERT_NOT_REACHED();
> }
> 
> That way, if we ever try to support some future DPI, we can find the problems quickly.

Done. (also in the non-mac code)

> 
> > Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:663
> > +            // Pattern: a b c c b a
> > +            //          d e f f e d
> > +            //          g h j j h g
> > +            //          k l m m l k
> > +            //          n o p p o n
> > +            //          q r s s r q
> > +            for (int x = 0; x < colPixels; ++x) {
> > +                uint32_t* row = misspellBitmap[index]->getAddr32(0, x);
> > +                row[0] = colors[index][x * 3];
> > +                row[1] = colors[index][x * 3 + 1];
> > +                row[2] = colors[index][x * 3 + 2];
> > +                row[3] = colors[index][x * 3 + 2];
> > +                row[4] = colors[index][x * 3 + 1];
> > +                row[5] = colors[index][x * 3];
> > +                row[6] = transparentColor;
> > +                row[7] = transparentColor;
> 
> Nit:  this looks like
> 
> a b c c b a
> d e f f e d
> g h j j h g
> g h j j h g
> d e f f e d
> a b c c b a
> 
> to me.

No, it's not x-symmetrical.
Comment 11 WebKit Review Bot 2012-10-16 11:34:47 PDT
Attachment 168986 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:643:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:645:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Stephen White 2012-10-16 11:37:54 PDT
Comment on attachment 168982 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168982&action=review

>>> Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:663
>>> +                row[7] = transparentColor;
>> 
>> Nit:  this looks like
>> 
>> a b c c b a
>> d e f f e d
>> g h j j h g
>> g h j j h g
>> d e f f e d
>> a b c c b a
>> 
>> to me.
> 
> No, it's not x-symmetrical.

Yeah, I misunderstood.  Sorry for the noise.
Comment 13 Stephen White 2012-10-16 11:38:24 PDT
Comment on attachment 168986 [details]
Patch

We agreed style-bot can be ignored.  Ignore other bots at your peril.  :)  r=me
Comment 14 WebKit Review Bot 2012-10-16 12:04:08 PDT
Comment on attachment 168986 [details]
Patch

Clearing flags on attachment: 168986

Committed r131483: <http://trac.webkit.org/changeset/131483>
Comment 15 WebKit Review Bot 2012-10-16 12:04:12 PDT
All reviewed patches have been landed.  Closing bug.