[Webkit-unassigned] [Bug 23340] Add remaining bits of platform/graphics/chromium

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 15 11:09:35 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=23340


eric at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #26744|review?(eric at webkit.org)    |review+
               Flag|                            |




------- Comment #2 from eric at webkit.org  2009-01-15 11:09 PDT -------
(From update of attachment 26744)
Indent (and static_cast)
 static inline float scaleEmToUnits(float x, int unitsPerEm)
 50 {
 51   return unitsPerEm ? x / (float)unitsPerEm : x;
 52 }

No need for the c-style cast:
126     // TEXTMETRICS have this.  Set m_treatAsFixedPitch based off that.
 127     HDC dc = GetDC((HWND)0);
0 works fine w/o cast

This code is copied at least twice:
59     TEXTMETRIC textMetric = {0};
 60     if (!GetTextMetrics(dc, &textMetric)) {
 61         if (ChromiumBridge::ensureFontLoaded(m_font.hfont())) {
 62             // Retry GetTextMetrics.
 63             // FIXME: Handle gracefully the error if this call also fails.
 64             // See http://crbug.com/6401.
 65             if (!GetTextMetrics(dc, &textMetric))
 66                 ASSERT_NOT_REACHED();
 67         }
 68     }
maybe it should be a static function?

Darin fisher learned I was wrong here:
   else
 71         // hack taken from the Windows port
 72         m_xHeight = static_cast<float>(m_ascent) * 0.56;
comments in else/if blocks supposedly cause them to be treated as multi-line by
the style guides.  At least that was darin adlers opinion which darin fisher
learned earlier this week.

spacing:
 static bool treatAsSpace(UChar c)
 46 {
 47    return c == ' ' || c == '\t' || c == '\n' || c == 0x00A0;
 48 }
 49 

numItems:
 478         int num_items = 0;
I think the code really means numberOfGlyphs? but I'm not sure.

{ on next line:
5     virtual bool nextWinFontData(HFONT*, SCRIPT_CACHE**,
SCRIPT_FONTPROPERTIES**, int* ascent) {
 346         return false;
 347     }

Looks fine.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list