Bug 176531 - [ARM] Building FELightningNEON.cpp fails due to missing {Point,Spot}LightSource declarations
Summary: [ARM] Building FELightningNEON.cpp fails due to missing {Point,Spot}LightSour...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-07 09:23 PDT by Adrian Perez
Modified: 2017-09-27 12:34 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.88 KB, patch)
2017-09-07 10:07 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch (v2) (3.88 KB, patch)
2017-09-07 10:40 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2017-09-07 09:23:33 PDT
SSIA. Compiler output (GCC 6) follows.

---

In file included from platform/graphics/filters/FELighting.cpp:30:0:
platform/graphics/cpu/arm/filters/FELightingNEON.h: In member function ‘void WebCore::FELighting::platformApplyNeon(WebCore::FELighting::LightingData&, WebCore::LightSource::PaintingData&)’:
platform/graphics/cpu/arm/filters/FELightingNEON.h:119:9: error: ‘PointLightSource’ was not declared in this scope
         PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
         ^~~~~~~~~~~~~~~~
platform/graphics/cpu/arm/filters/FELightingNEON.h:127:9: error: ‘SpotLightSource’ was not declared in this scope
         SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
         ^~~~~~~~~~~~~~~
Comment 1 Adrian Perez 2017-09-07 09:28:05 PDT
After adding the needed #include incantations, the compiler keeps
complaining (output below). From a cursory glance it looks like some
downcasting might be needed, I'm taking a look at the code.

---

In file included from platform/graphics/cpu/arm/filters/FELightingNEON.cpp:28:0:
platform/graphics/cpu/arm/filters/FELightingNEON.h: In member function ‘void WebCore::FELighting::platformApplyNeon(WebCore::FELighting::LightingData&, WebCore::LightSource::PaintingData&)’:
platform/graphics/cpu/arm/filters/FELightingNEON.h:121:96: error: invalid static_cast from type ‘WebCore::LightSource’ to type ‘WebCore::PointLightSource*’
         PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
                                                                                                ^
platform/graphics/cpu/arm/filters/FELightingNEON.h:128:93: error: invalid static_cast from type ‘WebCore::LightSource’ to type ‘WebCore::SpotLightSource*’
         SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
                                                                                             ^
Comment 2 Adrian Perez 2017-09-07 09:47:37 PDT
(In reply to Adrian Perez from comment #1)
> After adding the needed #include incantations, the compiler keeps
> complaining (output below). From a cursory glance it looks like some
> downcasting might be needed, I'm taking a look at the code.

Noup, m_lightSource is a Ref<LightSource>, and the Ref<T>::get() returns
a reference. The code has to be updated to make casts to the correct
reference types, and member access using the dot operator instead.

I'll be submitting a patch momentarily.
Comment 3 Adrian Perez 2017-09-07 10:07:05 PDT
Created attachment 320124 [details]
Patch
Comment 4 Adrian Perez 2017-09-07 10:40:42 PDT
Created attachment 320132 [details]
Patch (v2)

Now this version does the casts properly O:-)
Comment 5 WebKit Commit Bot 2017-09-07 11:22:49 PDT
Comment on attachment 320132 [details]
Patch (v2)

Clearing flags on attachment: 320132

Committed r221742: <http://trac.webkit.org/changeset/221742>
Comment 6 WebKit Commit Bot 2017-09-07 11:22:50 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2017-09-27 12:34:14 PDT
<rdar://problem/34693504>