1*4882a593SmuzhiyunFrom 646e347c173dbb9782492ac7cb4f54b65533ba90 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Martin Jansa <Martin.Jansa@gmail.com>
3*4882a593SmuzhiyunDate: Sun, 17 Oct 2021 20:49:21 +0000
4*4882a593SmuzhiyunSubject: [PATCH] Fix build without opengl-or-es
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun* fix build failure when opengl-or-es is disabled:
7*4882a593Smuzhiyun  In file included from /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/webkitgtk/2.34.0-r0/webkitgtk-2.34.0/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:30,
8*4882a593Smuzhiyun                   from /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/webkitgtk/2.34.0-r0/build/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-36.cpp:1:
9*4882a593Smuzhiyun  /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/webkitgtk/2.34.0-r0/webkitgtk-2.34.0/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:41:10: fatal error: WebCore/CoordinatedGraphicsLayer.h: No such file or directory
10*4882a593Smuzhiyun     41 | #include <WebCore/CoordinatedGraphicsLayer.h>
11*4882a593Smuzhiyun        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12*4882a593Smuzhiyun  compilation terminated.
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun* the CoordinatedGraphicsLayer.h header installation is controled by
15*4882a593Smuzhiyun  USE_COORDINATED_GRAPHICS in webkitgtk-2.34.0/Source/WebCore/platform/TextureMapper.cmake
16*4882a593Smuzhiyun  but in Source/cmake/OptionsGTK.cmake USE_COORDINATED_GRAPHICS was enabled only inside
17*4882a593Smuzhiyun  if (USE_OPENGL_OR_ES)
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunUpstream-Status: Submitted [https://bugs.webkit.org/show_bug.cgi?id=232934]
20*4882a593Smuzhiyun---
21*4882a593Smuzhiyun .../DrawingAreaProxyCoordinatedGraphics.cpp                 | 2 +-
22*4882a593Smuzhiyun .../DrawingAreaProxyCoordinatedGraphics.h                   | 2 +-
23*4882a593Smuzhiyun .../CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp  | 2 +-
24*4882a593Smuzhiyun .../CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h    | 2 +-
25*4882a593Smuzhiyun .../WebPage/CoordinatedGraphics/LayerTreeHost.cpp           | 4 ++--
26*4882a593Smuzhiyun .../WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h  | 6 +++---
27*4882a593Smuzhiyun 6 files changed, 9 insertions(+), 9 deletions(-)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyundiff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
30*4882a593Smuzhiyunindex 038d9ee2..5e828a10 100644
31*4882a593Smuzhiyun--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
32*4882a593Smuzhiyun+++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
33*4882a593Smuzhiyun@@ -152,7 +152,7 @@ void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBa
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun }
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun-#if PLATFORM(GTK)
38*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
39*4882a593Smuzhiyun void DrawingAreaProxyCoordinatedGraphics::adjustTransientZoom(double scale, FloatPoint origin)
40*4882a593Smuzhiyun {
41*4882a593Smuzhiyun     send(Messages::DrawingArea::AdjustTransientZoom(scale, origin));
42*4882a593Smuzhiyundiff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
43*4882a593Smuzhiyunindex b23a45ff..cd263402 100644
44*4882a593Smuzhiyun--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
45*4882a593Smuzhiyun+++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
46*4882a593Smuzhiyun@@ -57,7 +57,7 @@ private:
47*4882a593Smuzhiyun     void waitForBackingStoreUpdateOnNextPaint() override;
48*4882a593Smuzhiyun     void setBackingStoreIsDiscardable(bool) override;
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun-#if PLATFORM(GTK)
51*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
52*4882a593Smuzhiyun     void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override;
53*4882a593Smuzhiyun     void commitTransientZoom(double scale, WebCore::FloatPoint origin) override;
54*4882a593Smuzhiyun #endif
55*4882a593Smuzhiyundiff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
56*4882a593Smuzhiyunindex 33ac2e1d..42375784 100644
57*4882a593Smuzhiyun--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
58*4882a593Smuzhiyun+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
59*4882a593Smuzhiyun@@ -486,7 +486,7 @@ void DrawingAreaCoordinatedGraphics::didUpdate()
60*4882a593Smuzhiyun     displayTimerFired();
61*4882a593Smuzhiyun }
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun-#if PLATFORM(GTK)
64*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
65*4882a593Smuzhiyun void DrawingAreaCoordinatedGraphics::adjustTransientZoom(double scale, FloatPoint origin)
66*4882a593Smuzhiyun {
67*4882a593Smuzhiyun     if (!m_transientZoom) {
68*4882a593Smuzhiyundiff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
69*4882a593Smuzhiyunindex d8dc6df7..c8322364 100644
70*4882a593Smuzhiyun--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
71*4882a593Smuzhiyun+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
72*4882a593Smuzhiyun@@ -84,7 +84,7 @@ private:
73*4882a593Smuzhiyun     void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override;
74*4882a593Smuzhiyun     void didUpdate() override;
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun-#if PLATFORM(GTK)
77*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
78*4882a593Smuzhiyun     void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override;
79*4882a593Smuzhiyun     void commitTransientZoom(double scale, WebCore::FloatPoint origin) override;
80*4882a593Smuzhiyun #endif
81*4882a593Smuzhiyundiff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
82*4882a593Smuzhiyunindex f3304d10..ca0476ff 100644
83*4882a593Smuzhiyun--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
84*4882a593Smuzhiyun+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
85*4882a593Smuzhiyun@@ -156,7 +156,7 @@ void LayerTreeHost::layerFlushTimerFired()
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun     bool didSync = m_coordinator.flushPendingLayerChanges(flags);
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun-#if PLATFORM(GTK)
90*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
91*4882a593Smuzhiyun     // If we have an active transient zoom, we want the zoom to win over any changes
92*4882a593Smuzhiyun     // that WebCore makes to the relevant layers, so re-apply our changes after flushing.
93*4882a593Smuzhiyun     if (m_transientZoom)
94*4882a593Smuzhiyun@@ -453,7 +453,7 @@ void LayerTreeHost::renderNextFrame(bool forceRepaint)
95*4882a593Smuzhiyun     }
96*4882a593Smuzhiyun }
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun-#if PLATFORM(GTK)
99*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
100*4882a593Smuzhiyun FloatPoint LayerTreeHost::constrainTransientZoomOrigin(double scale, FloatPoint origin) const
101*4882a593Smuzhiyun {
102*4882a593Smuzhiyun     FrameView& frameView = *m_webPage.mainFrameView();
103*4882a593Smuzhiyundiff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
104*4882a593Smuzhiyunindex 4f727e41..b070266e 100644
105*4882a593Smuzhiyun--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
106*4882a593Smuzhiyun+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
107*4882a593Smuzhiyun@@ -37,7 +37,7 @@
108*4882a593Smuzhiyun #include <wtf/Forward.h>
109*4882a593Smuzhiyun #include <wtf/OptionSet.h>
110*4882a593Smuzhiyun #include <wtf/RunLoop.h>
111*4882a593Smuzhiyun-#if PLATFORM(GTK)
112*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
113*4882a593Smuzhiyun #include <WebCore/CoordinatedGraphicsLayer.h>
114*4882a593Smuzhiyun #endif
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun@@ -100,7 +100,7 @@ public:
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun     WebCore::PlatformDisplayID displayID() const { return m_displayID; }
119*4882a593Smuzhiyun
120*4882a593Smuzhiyun-#if PLATFORM(GTK)
121*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
122*4882a593Smuzhiyun     void adjustTransientZoom(double, WebCore::FloatPoint);
123*4882a593Smuzhiyun     void commitTransientZoom(double, WebCore::FloatPoint);
124*4882a593Smuzhiyun #endif
125*4882a593Smuzhiyun@@ -213,7 +213,7 @@ private:
126*4882a593Smuzhiyun #endif // USE(COORDINATED_GRAPHICS)
127*4882a593Smuzhiyun     WebCore::PlatformDisplayID m_displayID;
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun-#if PLATFORM(GTK)
130*4882a593Smuzhiyun+#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS)
131*4882a593Smuzhiyun     bool m_transientZoom { false };
132*4882a593Smuzhiyun     double m_transientZoomScale { 1 };
133*4882a593Smuzhiyun     WebCore::FloatPoint m_transientZoomOrigin;
134