@@ -8915,10 +8915,10 @@ index 0000000000000000000000000000000000000000..a957c3b2586d67caa78b96bb8644bab8
8915
8915
+} // namespace WebKit
8916
8916
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp
8917
8917
new file mode 100644
8918
- index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e79c12ff0
8918
+ index 0000000000000000000000000000000000000000..6e0c7ffce5201430c04c95247e812324ddd10d22
8919
8919
--- /dev/null
8920
8920
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp
8921
- @@ -0,0 +1,344 @@
8921
+ @@ -0,0 +1,335 @@
8922
8922
+/*
8923
8923
+ * Copyright (c) 2010, The WebM Project authors. All rights reserved.
8924
8924
+ * Copyright (c) 2013 The Chromium Authors. All rights reserved.
@@ -9072,13 +9072,6 @@ index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e
9072
9072
+ fwrite(header, 1, 12, outfile);
9073
9073
+}
9074
9074
+
9075
- +void ivf_write_frame_size(FILE *outfile, size_t frame_size) {
9076
- + char header[4];
9077
- +
9078
- + mem_put_le32(header, (int)frame_size);
9079
- + fwrite(header, 1, 4, outfile);
9080
- +}
9081
- +
9082
9075
+} // namespace
9083
9076
+
9084
9077
+class ScreencastEncoder::VPXCodec {
@@ -9097,7 +9090,8 @@ index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e
9097
9090
+ vpx_codec_iter_t iter = nullptr;
9098
9091
+ const vpx_codec_cx_pkt_t *pkt = nullptr;
9099
9092
+ int flags = 0;
9100
- + const vpx_codec_err_t res = vpx_codec_encode(&m_codec, img, m_frameCount, 1, flags, VPX_DL_REALTIME);
9093
+ + unsigned long duration = 1;
9094
+ + const vpx_codec_err_t res = vpx_codec_encode(&m_codec, img, m_pts, duration, flags, VPX_DL_REALTIME);
9101
9095
+ if (res != VPX_CODEC_OK) {
9102
9096
+ fprintf(stderr, "Failed to encode frame: %s\n", vpx_codec_error(&m_codec));
9103
9097
+ return false;
@@ -9107,17 +9101,16 @@ index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e
9107
9101
+ while ((pkt = vpx_codec_get_cx_data(&m_codec, &iter)) != nullptr) {
9108
9102
+ gotPkts = true;
9109
9103
+
9110
- + fprintf(stderr, " pkt->kind=%d\n", pkt->kind);
9111
9104
+ if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
9112
- + const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
9113
- + ivf_write_frame_header(m_file, pkt->data.frame.pts, pkt->data.frame.sz);
9105
+ + ivf_write_frame_header(m_file, m_pts, pkt->data.frame.sz);
9114
9106
+ if (fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz, m_file) != pkt->data.frame.sz) {
9115
9107
+ fprintf(stderr, "Failed to write compressed frame\n");
9116
9108
+ return 0;
9117
9109
+ }
9118
- +
9110
+ + bool keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
9111
+ + fprintf(stderr, " %spts=%ld sz=%ld\n", keyframe ? "[K] " : "", pkt->data.frame.pts, pkt->data.frame.sz);
9112
+ + m_pts += pkt->data.frame.duration;
9119
9113
+ ++m_frameCount;
9120
- + fprintf(stderr, " writtend frame (key=%d)\n", keyframe);
9121
9114
+ }
9122
9115
+ }
9123
9116
+
@@ -9143,6 +9136,7 @@ index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e
9143
9136
+ vpx_codec_enc_cfg_t m_cfg;
9144
9137
+ FILE* m_file = nullptr;
9145
9138
+ int m_frameCount = 0;
9139
+ + int64_t m_pts;
9146
9140
+};
9147
9141
+
9148
9142
+ScreencastEncoder::ScreencastEncoder(std::unique_ptr<VPXCodec>&& vpxCodec)
@@ -9185,7 +9179,6 @@ index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e
9185
9179
+ const int fps = 30;
9186
9180
+ cfg.g_timebase.num = 1;
9187
9181
+ cfg.g_timebase.den = fps;
9188
- + cfg.rc_target_bitrate = 200;
9189
9182
+ cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT;
9190
9183
+
9191
9184
+ vpx_codec_ctx_t codec;
@@ -9208,8 +9201,6 @@ index 0000000000000000000000000000000000000000..05af437266cb8d561e848c63fdb4056e
9208
9201
+void ScreencastEncoder::encodeFrame(cairo_surface_t* drawingAreaSurface)
9209
9202
+{
9210
9203
+ fprintf(stderr, "ScreencastEncoder::encodeFrame\n");
9211
- + // fprintf(stderr, "cairo_surface_get_type(image)=%d CAIRO_SURFACE_TYPE_IMAGE=%d CAIRO_SURFACE_TYPE_XLIB=%d\n", cairo_surface_get_type(drawingAreaSurface), CAIRO_SURFACE_TYPE_IMAGE, CAIRO_SURFACE_TYPE_XLIB);
9212
- + // fprintf(stderr, "cairo_image_surface_get_format(image)=%d CAIRO_FORMAT_ARGB32=%d\n", cairo_image_surface_get_format(drawingAreaSurface), CAIRO_FORMAT_ARGB32);
9213
9204
+
9214
9205
+ IntSize size = cairoSurfaceSize(drawingAreaSurface);
9215
9206
+ if (size.isZero()) {
@@ -12593,6 +12584,29 @@ index 964c6315e38f5e0a0303febce45b1e975054f0b4..117d8c7c74bc81b34cfc0fe2b11a5429
12593
12584
#if HAVE(APP_SSO)
12594
12585
UniqueRef<SOAuthorizationCoordinator> m_soAuthorizationCoordinator;
12595
12586
#endif
12587
+ diff --git a/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp b/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp
12588
+ index dc0a70b8824afdc7ec3dd1f69f4d9b51942924f6..012bf01a2307986292589ab1808f1df05dc060f7 100644
12589
+ --- a/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp
12590
+ +++ b/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp
12591
+ @@ -27,6 +27,7 @@
12592
+ #include "config.h"
12593
+ #include "BackingStore.h"
12594
+
12595
+ +#include "DrawingAreaProxyCoordinatedGraphics.h"
12596
+ #include "ShareableBitmap.h"
12597
+ #include "UpdateInfo.h"
12598
+ #include "WebPageProxy.h"
12599
+ @@ -72,6 +73,10 @@ void BackingStore::paint(cairo_t* context, const IntRect& rect)
12600
+ cairo_rectangle(context, rect.x(), rect.y(), rect.width(), rect.height());
12601
+ cairo_fill(context);
12602
+ cairo_restore(context);
12603
+ +#if PLATFORM(GTK)
12604
+ + if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_webPageProxy.drawingArea()))
12605
+ + drawingArea->didPaint(m_backend->surface());
12606
+ +#endif
12607
+ }
12608
+
12609
+ void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo& updateInfo)
12596
12610
diff --git a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp
12597
12611
index 7ba39332bce6e28f0f4b2f7acf636f835c54f486..7c3d8125df147b6049075491b12cce1dc84bf514 100644
12598
12612
--- a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp
0 commit comments