Bug 24947 - Special-case chromium drawing text-shadow when opaque color & no shadow blur
Summary: Special-case chromium drawing text-shadow when opaque color & no shadow blur
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Rafael Weinstein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-30 14:50 PDT by Rafael Weinstein
Modified: 2009-03-31 09:46 PDT (History)
1 user (show)

See Also:


Attachments
Let GDI draw text-shadow on opaque colors and 0 blur (5.40 KB, patch)
2009-03-30 14:52 PDT, Rafael Weinstein
fishd: review-
Details | Formatted Diff | Diff
Spaces removed, variables now reflect webkit style guide (5.37 KB, patch)
2009-03-30 15:46 PDT, Rafael Weinstein
eric: review-
Details | Formatted Diff | Diff
Changes from Comment #6 (Eric Seidel) (5.79 KB, patch)
2009-03-30 17:55 PDT, Rafael Weinstein
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Weinstein 2009-03-30 14:50:49 PDT
This patch special-cases drawing of text-shadows on the chromium port to let GDI draw the text and text shadow, by passing Skia. This only occurs when both the text fill color and shadow color are opaque and the text shadow is 0 blur.
Comment 1 Rafael Weinstein 2009-03-30 14:52:24 PDT
Created attachment 29088 [details]
Let GDI draw text-shadow on opaque colors and 0 blur
Comment 2 Mark Rowe (bdash) 2009-03-30 15:03:34 PDT
Comment on attachment 29088 [details]
Let GDI draw text-shadow on opaque colors and 0 blur

Clearing review flag as it was set to + by a non-reviewer.
Comment 3 Darin Fisher (:fishd, Google) 2009-03-30 15:05:40 PDT
Comment on attachment 29088 [details]
Let GDI draw text-shadow on opaque colors and 0 blur

>Index: ChangeLog
...
>+        Reviewed by NOBODY (OOPS!).
>+
>+	Special-case drawing text-shadow on win32, to let GDI draw in cases when both fill & 
>+	shadow color are opaque and the shadow has no blur.

replace tabs with spaces.


>Index: platform/graphics/chromium/FontChromiumWin.cpp

>+    IntSize shadow_size;
>+    int shadow_blur;
>+    Color shadow_color;

please use webkit style for naming variables:
http://webkit.org/coding/coding-style.html


>Index: platform/graphics/skia/SkiaFontWin.cpp

>+bool windowsCanHandleDrawTextShadow(WebCore::GraphicsContext *context) {
>+    IntSize shadow_size;
>+    int shadow_blur;
>+    Color shadow_color;

ditto
Comment 4 Eric Seidel (no email) 2009-03-30 15:06:15 PDT
See:
http://webkit.org/coding/coding-style.html
for information on WebKit coding style.
Comment 5 Rafael Weinstein 2009-03-30 15:46:28 PDT
Created attachment 29092 [details]
Spaces removed, variables now reflect webkit style guide
Comment 6 Eric Seidel (no email) 2009-03-30 15:53:11 PDT
Comment on attachment 29092 [details]
Spaces removed, variables now reflect webkit style guide

The bug url should be in the ChangeLog.

Much stronger would be to ASSERT these conditions instead of just makign a comment:

+    // Note: If the fillColor or shadowColor are ever non-opaque, we should 
+    // never reach this code. SkiaFontWin::windowsCanHandleTextDrawing() will
+    // have set m_useGDI == false and the above check will have passed and 
+    // the this function returned.

tempColor isn't a very descriptiveName.

textColor would probably be better.

savedColor or savedTextColor would be better than "saveColor".

+bool windowsCanHandleDrawTextShadow(WebCore::GraphicsContext *context) {

{ should be on its own line.

"context" is not needed here (nor on the line after) as it provides no additional description to purpose of the argument (See style guide).

+bool windowsCanHandleDrawTextShadow(GraphicsContext *context);
Comment 7 Eric Seidel (no email) 2009-03-30 15:54:26 PDT
Comment on attachment 29092 [details]
Spaces removed, variables now reflect webkit style guide

I can't really comment on if this is the right approach or not.  Maybe fishd or brettw can.
Comment 8 Rafael Weinstein 2009-03-30 17:55:01 PDT
Created attachment 29101 [details]
Changes from Comment #6 (Eric Seidel)

-ASSERT()s used rather than second check of windowCanHandleDrawTextShadow()
-tempColor -> textColor
-saveColor -> savedTextColor
-formatting
-"context" removed from function declaration of both *canHandle*Text functions
Comment 9 Rafael Weinstein 2009-03-30 17:56:45 PDT
I pre-reviewed this approach with brettw and made his corrections before submitting here.

(In reply to comment #7)
> (From update of attachment 29092 [details] [review])
> I can't really comment on if this is the right approach or not.  Maybe fishd or
> brettw can.
> 

Comment 10 Eric Seidel (no email) 2009-03-30 18:23:01 PDT
Comment on attachment 29101 [details]
Changes from Comment #6 (Eric Seidel)

Looks fine.  Thanks!
Comment 11 Darin Fisher (:fishd, Google) 2009-03-31 09:46:55 PDT
Landed as:  http://trac.webkit.org/changeset/42131