Bug 159259 - Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea
Summary: Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 159212
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-29 05:07 PDT by Carlos Garcia Campos
Modified: 2016-07-06 04:32 PDT (History)
4 users (show)

See Also:


Attachments
Patch (65.17 KB, patch)
2016-06-29 05:10 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Updated patch (67.74 KB, patch)
2016-07-04 23:58 PDT, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-06-29 05:07:27 PDT
It seems that CoordinatedDrawingArea is just a copy paste of DrawingAreaImpl with non-accelerated code path removed. There's actually nothing (or very little) specific to coordinated graphics in the CoordinatedDrawingArea implementation.
Comment 1 Carlos Garcia Campos 2016-06-29 05:10:40 PDT
Created attachment 282340 [details]
Patch
Comment 2 Anders Carlsson 2016-06-29 17:48:24 PDT
Comment on attachment 282340 [details]
Patch

If you could get rid of DrawingAreaImpl, that would be great. I sent out an e-mail telling people that I'd like to get rid of it a while back.
Comment 3 Carlos Garcia Campos 2016-06-29 23:32:27 PDT
(In reply to comment #2)
> Comment on attachment 282340 [details]
> Patch
> 
> If you could get rid of DrawingAreaImpl, that would be great. I sent out an
> e-mail telling people that I'd like to get rid of it a while back.

Not yet. The GTK+ port still enters/leaves AC mode when required, so we still need the non accelerated code path. We plan to switch to using the threaded compositor, which forces AC mode, but it's not really ready yet. Good thing is that after this patch, once we switch to threaded compositor, we can just remove DrawingAreaImpl and use AcceleratedDrawginArea. In the meantime, since Impl is only used by the GTK+ port, I can rename it to DrawingAreaGtk and move it to WebPage/gtk dir.
Comment 4 Carlos Garcia Campos 2016-07-04 23:58:40 PDT
Created attachment 282750 [details]
Updated patch

This should apply now
Comment 5 Zan Dobersek 2016-07-06 02:00:51 PDT
Comment on attachment 282750 [details]
Updated patch

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

> Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp:91
> +void AcceleratedDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
> +{
> +    if (!m_isPaintingEnabled)
> +        return;
> +
> +    m_layerTreeHost->scrollNonCompositedContents(scrollRect);
> +}
> +
> +void AcceleratedDrawingArea::pageBackgroundTransparencyChanged()
> +{
> +    if (m_layerTreeHost)
> +        m_layerTreeHost->pageBackgroundTransparencyChanged();
> +}

These differences in null-checking m_layerTreeHost are annoying.
Comment 6 Carlos Garcia Campos 2016-07-06 04:32:55 PDT
Committed r202855: <http://trac.webkit.org/changeset/202855>