Bug 179967 - [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
Summary: [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with...
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:
 
Reported: 2017-11-23 00:07 PST by Zan Dobersek
Modified: 2017-11-23 01:27 PST (History)
3 users (show)

See Also:


Attachments
Patch (56.14 KB, patch)
2017-11-23 00:18 PST, Zan Dobersek
cgarcia: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2017-11-23 00:07:15 PST
[CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
Comment 1 Zan Dobersek 2017-11-23 00:18:24 PST
Created attachment 327485 [details]
Patch
Comment 2 Carlos Garcia Campos 2017-11-23 01:06:58 PST
Comment on attachment 327485 [details]
Patch

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

> Source/WebKit/ChangeLog:13
> +
> +        
> +

Remove extra empty lines here, please.

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:53
> +void CoordinatedBuffer::paintToSurface(const IntRect& rect, Client& client)

I'm confused about this, what surface is this painting to? Maybe we could rename it to paintToBuffer now, or simply paint() since buffer is this, no?

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:59
> +    client.paintToSurfaceContext(context);

I would also rename this to paintToContext()

> Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:105
>      UpdateAtlasSurfaceClient surfaceClient(client, size, supportsAlpha());
> -    m_surface->paintToSurface(rect, surfaceClient);
> +    m_buffer->paintToSurface(rect, surfaceClient);

Wow, this CoordinatedBuffer::Client is a bit messy. Here we have UpdateAtlasSurfaceClient which is a CoordinatedBuffer::Client but receives another CoordinatedBuffer::Client as parameter. Could we avoid this client mess by simply using lambdas to render into the context? CoordinatedBuffer::paint() could receive a Function <void (GraphicsContext&)>. I'm not suggesting to do that in this patch, just wondering if that would be possible.
Comment 3 Zan Dobersek 2017-11-23 01:15:24 PST
Comment on attachment 327485 [details]
Patch

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

>> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:53
>> +void CoordinatedBuffer::paintToSurface(const IntRect& rect, Client& client)
> 
> I'm confused about this, what surface is this painting to? Maybe we could rename it to paintToBuffer now, or simply paint() since buffer is this, no?

I have this and other "paint to surface" methods removed in the stashed work. That's why I didn't bother renaming them.

>> Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:105
>> +    m_buffer->paintToSurface(rect, surfaceClient);
> 
> Wow, this CoordinatedBuffer::Client is a bit messy. Here we have UpdateAtlasSurfaceClient which is a CoordinatedBuffer::Client but receives another CoordinatedBuffer::Client as parameter. Could we avoid this client mess by simply using lambdas to render into the context? CoordinatedBuffer::paint() could receive a Function <void (GraphicsContext&)>. I'm not suggesting to do that in this patch, just wondering if that would be possible.

This will also be simplified to the point where CoordinatedBuffer::Client will be possible to remove.
Comment 4 Zan Dobersek 2017-11-23 01:17:11 PST
Committed r225108: <https://trac.webkit.org/changeset/225108>
Comment 5 Radar WebKit Bug Importer 2017-11-23 01:20:09 PST
<rdar://problem/35674166>
Comment 6 Carlos Garcia Campos 2017-11-23 01:27:49 PST
(In reply to Zan Dobersek from comment #3)
> Comment on attachment 327485 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=327485&action=review
> 
> >> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:53
> >> +void CoordinatedBuffer::paintToSurface(const IntRect& rect, Client& client)
> > 
> > I'm confused about this, what surface is this painting to? Maybe we could rename it to paintToBuffer now, or simply paint() since buffer is this, no?
> 
> I have this and other "paint to surface" methods removed in the stashed
> work. That's why I didn't bother renaming them.
> 
> >> Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:105
> >> +    m_buffer->paintToSurface(rect, surfaceClient);
> > 
> > Wow, this CoordinatedBuffer::Client is a bit messy. Here we have UpdateAtlasSurfaceClient which is a CoordinatedBuffer::Client but receives another CoordinatedBuffer::Client as parameter. Could we avoid this client mess by simply using lambdas to render into the context? CoordinatedBuffer::paint() could receive a Function <void (GraphicsContext&)>. I'm not suggesting to do that in this patch, just wondering if that would be possible.
> 
> This will also be simplified to the point where CoordinatedBuffer::Client
> will be possible to remove.

\o/