Commit 1bd3d2f
committed
[WPE][Skia] Enable MSAA when available
https://bugs.webkit.org/show_bug.cgi?id=277800
Reviewed by Carlos Garcia Campos.
Enable MSAA on WPE whenever possible. On x86 or x86_64, use eight samples
to get an antialiasing result similar to non MSAA. On embedded devices, use
four samples instead, as this is a nice compromise between quality and
resource usage. On GTK keep it disabled by default. The user can overwrite
this default value through the WEBKIT_MSAA_SAMPLE_COUNT env var.
Even if MSAA is reported as available by GLES, Skia has a lot of internal checks
that may disable it, so the best way to check whether we can use it with Skia is
trying to create a texture backed SkSurface with a sample count of four and
check whether it works.
* Source/WebCore/platform/graphics/PlatformDisplay.h:
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp:
(WebCore::ImageBufferSkiaAcceleratedBackend::create):
(WebCore::flushSurfaceIfNeeded):
(WebCore::ImageBufferSkiaAcceleratedBackend::copyNativeImage):
(WebCore::ImageBufferSkiaAcceleratedBackend::createNativeImageReference):
* Source/WebCore/platform/graphics/skia/PlatformDisplaySkia.cpp:
(WebCore::initializeMSAASampleCount):
(WebCore::SkiaGLContext::sampleCount):
(WebCore::SkiaGLContext::SkiaGLContext):
(WebCore::PlatformDisplay::msaaSampleCount):
* Source/WebCore/platform/graphics/skia/SkiaAcceleratedBufferPool.cpp:
(WebCore::SkiaAcceleratedBufferPool::createAcceleratedBuffer):
Canonical link: https://commits.webkit.org/282223@main1 parent 5a46936 commit 1bd3d2f
4 files changed
Lines changed: 76 additions & 2 deletions
File tree
- Source/WebCore/platform/graphics
- skia
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
110 | 124 | | |
111 | 125 | | |
112 | 126 | | |
| 127 | + | |
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
116 | 131 | | |
117 | 132 | | |
| 133 | + | |
118 | 134 | | |
119 | 135 | | |
120 | 136 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
53 | 71 | | |
54 | 72 | | |
55 | 73 | | |
| |||
66 | 84 | | |
67 | 85 | | |
68 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
69 | 113 | | |
70 | 114 | | |
71 | 115 | | |
| |||
102 | 146 | | |
103 | 147 | | |
104 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
105 | 154 | | |
106 | 155 | | |
107 | 156 | | |
| |||
115 | 164 | | |
116 | 165 | | |
117 | 166 | | |
| 167 | + | |
| 168 | + | |
118 | 169 | | |
119 | 170 | | |
120 | 171 | | |
| |||
128 | 179 | | |
129 | 180 | | |
130 | 181 | | |
| 182 | + | |
131 | 183 | | |
132 | 184 | | |
133 | 185 | | |
| |||
152 | 204 | | |
153 | 205 | | |
154 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
155 | 212 | | |
156 | 213 | | |
157 | 214 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
0 commit comments