Bug 24757 - Chromium port doesn't support opacity on complex text
Summary: Chromium port doesn't support opacity on complex text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Brett Wilson (Google)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-23 08:01 PDT by Brett Wilson (Google)
Modified: 2009-03-25 11:18 PDT (History)
0 users

See Also:


Attachments
Patch (18.93 KB, patch)
2009-03-23 08:02 PDT, Brett Wilson (Google)
eric: review-
Details | Formatted Diff | Diff
Patch v2 (21.49 KB, patch)
2009-03-25 11:12 PDT, Brett Wilson (Google)
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Wilson (Google) 2009-03-23 08:01:41 PDT
It isn't hooked up to the TransparencyWin object which handles the text transparency.

Chromium bug: http://code.google.com/p/chromium/issues/detail?id=8768
Comment 1 Brett Wilson (Google) 2009-03-23 08:02:03 PDT
Created attachment 28852 [details]
Patch
Comment 2 Eric Seidel (no email) 2009-03-23 08:52:00 PDT
Comment on attachment 28852 [details]
Patch

ChangeLog needed.

I'm surprised there isn't a test to cover this already?

WK style is "init()":
     void Init();

I'm unclear as to why Init needs to be separate from construction?  (And I'm also not sure why a generalized "init" function is preferred over the old initForGDI())

Otherwise this looks fine.  I think mostly it just needs a ChangeLog to document what you're doing (so the reviewer can more easily understand what you're doing). ;)
Comment 3 Dimitri Glazkov (Google) 2009-03-23 08:52:04 PDT
Comment on attachment 28852 [details]
Patch

This looks good, except for these nits:

Don't forget the ChangeLog entry.

> +    TransparencyAwareFontPainter(GraphicsContext* context, const FloatPoint& point);

No need for argument names in declaration unless they need additional explanation. 

> +protected:
> +    // Called by our subclass' constructor to initialize GDI if necessary. This
> +    // is a separate function so it can be called after the subclass finishes
> +    // construction (it calls virtual functions).
> +    void Init();

init();

> + public:
> +    TransparencyAwareGlyphPainter(GraphicsContext* context,
> +                                  const SimpleFontData* font,
> +                                  const GlyphBuffer& glyphBuffer,
> +                                  int from, int numGlyphs,
> +                                  const FloatPoint& point);

Same here, args don't need names, except for "from" and "numGlyphs".

> +    bool drawGlyphs(int numGlyphs, const WORD* glyphs, const int* advances,
> +                    int startAdvance) const;

Ditto.
> +    return IntRect(m_point.x() - (m_font->ascent() + m_font->descent()) / 2,
> +                   m_point.y() - m_font->ascent() - m_font->lineGap(),
> +                   totalWidth + m_font->ascent() + m_font->descent(),
> +                   m_font->lineSpacing()); 

Is this computation the same for Uniscribe, just with different params? Maybe we could have a local static here to keep it in one place?

> +    TransparencyAwareUniscribePainter(GraphicsContext* context,
> +                                      const Font* font,
> +                                      const TextRun& run,
> +                                      int from, int to,
> +                                      const FloatPoint& point);

Same here about args.
Comment 4 Brett Wilson (Google) 2009-03-23 09:09:36 PDT
(In reply to comment #2)
> I'm unclear as to why Init needs to be separate from construction?  (And I'm
> also not sure why a generalized "init" function is preferred over the old
> initForGDI())

This is documented in the comment above the Init declaration:
+    // Called by our subclass' constructor to initialize GDI if necessary. This
+    // is a separate function so it can be called after the subclass finishes
+    // construction (it calls virtual functions).
Comment 5 Brett Wilson (Google) 2009-03-25 11:12:56 PDT
Created attachment 28936 [details]
Patch v2
Comment 6 Dimitri Glazkov (Google) 2009-03-25 11:16:38 PDT
Comment on attachment 28936 [details]
Patch v2

Nice.
Comment 7 Brett Wilson (Google) 2009-03-25 11:18:30 PDT
Fixed in r41978