Summary: | [EFL] Refactor ewk_view_context_paint code. | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tomasz Morawski <t.morawski> | ||||||||||
Component: | WebKit EFL | Assignee: | Nobody <webkit-unassigned> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | antognolli+webkit, g.czajkowski, gyuyoung.kim, leandro, lucas.de.marchi, rakuco, webkit.review.bot | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Tomasz Morawski
2012-05-04 01:00:36 PDT
Created attachment 140176 [details]
ewk_view_context_paint related changes
Attachment 140176 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'Source/WebKit/ChangeLog', u'..." exit_code: 1
Source/WebKit/efl/ewk/ewk_paint_context_private.h:32: Alphabetical sorting problem. [build/include_order] [4]
Source/WebKit/efl/ewk/ewk_paint_context.cpp:23: Alphabetical sorting problem. [build/include_order] [4]
Source/WebKit/efl/ewk/ewk_paint_context.cpp:47: Declaration has space between type name and * in Ewk_Paint_Context *context [whitespace/declaration] [3]
Source/WebKit/efl/ewk/ewk_paint_context.cpp:171: Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]
Total errors found: 4 in 14 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 140178 [details]
ewk_view_context_paint related changes 2
Generally I'm fine with those changes. We should be aware that this patch introduces a new private file for paint_context component. View in context: https://bugs.webkit.org/attachment.cgi?id=140178&action=review > Source/WebKit/efl/ewk/ewk_paint_context.cpp:30 > + Ewk_Paint_Context* context = new Ewk_Paint_Context; What about using smart pointers here? OwnPtr<Ewk_Paint_Context> context = adoptPtr(new Ewk_Paint_Context) > Source/WebKit/efl/ewk/ewk_paint_context.cpp:103 > + if (context->image && context->pixels) Braces should be added here: if (condition) { // Some comment doIt(); } > Source/WebKit/efl/ewk/ewk_paint_context.cpp:153 > + WebCore::IntRect rect(*area); Can you use a more descriptive variable for example, areaToPaint? > Source/WebKit/efl/ewk/ewk_paint_context.cpp:166 > + WebCore::IntRect rect(*area); Ditto. > Source/WebKit/efl/ewk/ewk_paint_context_private.h:23 > + * @brief Describes the paint context API. I wouldn't rather mention about API here. It's an internal file that won't be exported to an application layer. Please use different name: functions, internals etc. > Source/WebKit/efl/ewk/ewk_paint_context_private.h:41 > + * @internal In my opinion all definitions in this file should have @internal tag in first line of documentation. > Source/WebKit/efl/ewk/ewk_paint_context_private.h:67 > +EAPI Ewk_Paint_Context* ewk_paint_context_new(cairo_t* cairo); EAPI doesn't looks well in private files. We need to find better way before landing this patch. > Source/WebKit/efl/ewk/ewk_paint_context_private.h:72 > + * @param image to use as paint destination Please mention that it must not be 0. > Source/WebKit/efl/ewk/ewk_paint_context_private.h:85 > + * @param pixel pointer to pixel buffer Ditto. > Source/WebKit/efl/ewk/ewk_private.h:180 > +EAPI Eina_Bool ewk_view_paint(Ewk_View_Private_Data* priv, Ewk_Paint_Context* context, const Eina_Rectangle* area); I understand that those functions are used by DumpRenderTree. Is there any better way to use them internally and remove EAPI prefix? (In reply to comment #4) > Generally I'm fine with those changes. We should be aware that this patch introduces a new private file for paint_context component. > > View in context: https://bugs.webkit.org/attachment.cgi?id=140178&action=review > > > Source/WebKit/efl/ewk/ewk_paint_context.cpp:30 > > + Ewk_Paint_Context* context = new Ewk_Paint_Context; > > What about using smart pointers here? > OwnPtr<Ewk_Paint_Context> context = adoptPtr(new Ewk_Paint_Context) > > > Source/WebKit/efl/ewk/ewk_paint_context.cpp:103 > > + if (context->image && context->pixels) > > Braces should be added here: > if (condition) { > // Some comment > doIt(); > } > > > Source/WebKit/efl/ewk/ewk_paint_context.cpp:153 > > + WebCore::IntRect rect(*area); > > Can you use a more descriptive variable for example, areaToPaint? > > > Source/WebKit/efl/ewk/ewk_paint_context.cpp:166 > > + WebCore::IntRect rect(*area); > > Ditto. > > > Source/WebKit/efl/ewk/ewk_paint_context_private.h:23 > > + * @brief Describes the paint context API. > > I wouldn't rather mention about API here. It's an internal file that won't be exported to an application layer. Please use different name: functions, internals etc. > > > Source/WebKit/efl/ewk/ewk_paint_context_private.h:41 > > + * @internal > > In my opinion all definitions in this file should have @internal tag in first line of documentation. > > > Source/WebKit/efl/ewk/ewk_paint_context_private.h:67 > > +EAPI Ewk_Paint_Context* ewk_paint_context_new(cairo_t* cairo); > > EAPI doesn't looks well in private files. We need to find better way before landing this patch. > > > Source/WebKit/efl/ewk/ewk_paint_context_private.h:72 > > + * @param image to use as paint destination > > Please mention that it must not be 0. > > > Source/WebKit/efl/ewk/ewk_paint_context_private.h:85 > > + * @param pixel pointer to pixel buffer > > Ditto. > > > Source/WebKit/efl/ewk/ewk_private.h:180 > > +EAPI Eina_Bool ewk_view_paint(Ewk_View_Private_Data* priv, Ewk_Paint_Context* context, const Eina_Rectangle* area); > > I understand that those functions are used by DumpRenderTree. Is there any better way to use them internally and remove EAPI prefix? Thank you for your review. I will try to remove EAPI prefix from that function. Created attachment 140711 [details]
ewk_view_context_paint related changes 3
Comment on attachment 140711 [details]
ewk_view_context_paint related changes 3
Looks fantastic !! Though this patch is a little huge, I think efl port needs to land this patch.
LGTM from my side. CC'ing backing store developers. Created attachment 145252 [details]
ewk_view_context_paint related changes 4
Patch rebased. Comment on attachment 145252 [details]
ewk_view_context_paint related changes 4
Rubberstamping.
Comment on attachment 145252 [details] ewk_view_context_paint related changes 4 Clearing flags on attachment: 145252 Committed r119374: <http://trac.webkit.org/changeset/119374> All reviewed patches have been landed. Closing bug. |