Bug 187693 - [Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
Summary: [Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords: InRadar
Depends on:
Blocks: 187385
  Show dependency treegraph
 
Reported: 2018-07-16 03:09 PDT by Zan Dobersek
Modified: 2018-07-16 05:25 PDT (History)
2 users (show)

See Also:


Attachments
Patch (22.59 KB, patch)
2018-07-16 04:06 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (22.53 KB, patch)
2018-07-16 05:09 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2018-07-16 03:09:37 PDT
[Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
Comment 1 Zan Dobersek 2018-07-16 04:06:36 PDT
Created attachment 345088 [details]
Patch
Comment 2 Carlos Garcia Campos 2018-07-16 04:36:01 PDT
Comment on attachment 345088 [details]
Patch

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

> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:45
> +    PlatformLayer(uint64_t);

explicit. If this is abstract, it's probably better to make the constructor protected.

> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:48
> +    virtual bool isCompositionLayer() const { return false; }

Should this be pure virtual instead?

> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:62
> +    CompositionLayer(uint64_t);

explicit. Since this is refcounted, I think it would be better to add a create function returning a Ref<> and make the constructor private.

> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:70
> +                : value(0)

Could we init this below?

> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:89
> +                uint32_t value;

with { 0 } here?

> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:112
> +                uint32_t value;

Same here, and only init in the constructor the values that are true, is that possible?
Comment 3 Zan Dobersek 2018-07-16 04:55:12 PDT
Comment on attachment 345088 [details]
Patch

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

>> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:45
>> +    PlatformLayer(uint64_t);
> 
> explicit. If this is abstract, it's probably better to make the constructor protected.

OK.

>> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:48
>> +    virtual bool isCompositionLayer() const { return false; }
> 
> Should this be pure virtual instead?

Other methods corresponding to additional derived classes will be added here. By default they all return false, but in the derived classes the appropriate method is overridden to return true. This is typical for class hierarchies that leverage is<>() and downcast<>() typecasting.

>> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:62
>> +    CompositionLayer(uint64_t);
> 
> explicit. Since this is refcounted, I think it would be better to add a create function returning a Ref<> and make the constructor private.

OK.

>> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:89
>> +                uint32_t value;
> 
> with { 0 } here?

I don't think we can because of this being an union.

>> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:112
>> +                uint32_t value;
> 
> Same here, and only init in the constructor the values that are true, is that possible?

Similar here, don't think it's possible because of the union.
Comment 4 Zan Dobersek 2018-07-16 05:04:54 PDT
Comment on attachment 345088 [details]
Patch

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

>>> Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h:89
>>> +                uint32_t value;
>> 
>> with { 0 } here?
> 
> I don't think we can because of this being an union.

Turns out we can.
Comment 5 Zan Dobersek 2018-07-16 05:09:57 PDT
Created attachment 345089 [details]
Patch for landing
Comment 6 Zan Dobersek 2018-07-16 05:24:10 PDT
Comment on attachment 345089 [details]
Patch for landing

Clearing flags on attachment: 345089

Committed r233845: <https://trac.webkit.org/changeset/233845>
Comment 7 Zan Dobersek 2018-07-16 05:24:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-07-16 05:25:18 PDT
<rdar://problem/42237305>