Bug 175782 - Cleanup TextPainter
Summary: Cleanup TextPainter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-21 14:13 PDT by Daniel Bates
Modified: 2017-08-21 16:22 PDT (History)
4 users (show)

See Also:


Attachments
Patch (20.68 KB, patch)
2017-08-21 14:23 PDT, Daniel Bates
mmaxfield: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2017-08-21 14:13:19 PDT
Remove redundant mention of "text" in the name of TextPainter member functions, add separate setters for selection and non-selection shadows, and do some other minor cleanups.
Comment 1 Daniel Bates 2017-08-21 14:23:41 PDT
Created attachment 318671 [details]
Patch
Comment 2 Build Bot 2017-08-21 14:26:31 PDT
Attachment 318671 [details] did not pass style-queue:


ERROR: Source/WebCore/rendering/TextPainter.cpp:36:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Myles C. Maxfield 2017-08-21 14:49:58 PDT
Comment on attachment 318671 [details]
Patch

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

> Source/WebCore/rendering/TextPainter.cpp:4
> + * Copyright (C) 2004-2017 Apple Inc. All rights reserved.

Are we actually allowed to retroactively add in 2014-2016?

> Source/WebCore/rendering/TextPainter.cpp:40
> +    : m_context { context }
> +    , m_shadow { shadow }
> +    , m_onlyDrawsShadow { !isLastShadowIteration() || !lastShadowIterationShouldDrawText }
> +    , m_avoidDrawingShadow { shadowIsCompletelyCoveredByText(opaque) }
> +    , m_nothingToDraw { shadow && m_avoidDrawingShadow && m_onlyDrawsShadow }
> +    , m_didSaveContext { false }

What's the reason for this change? I haven't seen this style in any other code.
Comment 4 Daniel Bates 2017-08-21 16:19:21 PDT
Comment on attachment 318671 [details]
Patch

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

>> Source/WebCore/rendering/TextPainter.cpp:4
>> + * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
> 
> Are we actually allowed to retroactively add in 2014-2016?

Yes, Apple employees made changes throughout 2014-2016.

>> Source/WebCore/rendering/TextPainter.cpp:40
>> +    , m_didSaveContext { false }
> 
> What's the reason for this change? I haven't seen this style in any other code.

We should bring this up on webkit-dev to standardize. I have seen a movement towards using this style. See bug #173682, comment #4.
Comment 5 Daniel Bates 2017-08-21 16:21:29 PDT
Committed r220988: <http://trac.webkit.org/changeset/220988>
Comment 6 Radar WebKit Bug Importer 2017-08-21 16:22:03 PDT
<rdar://problem/34001905>