Files
electron/shell/browser/osr/osr_paint_event.h
electron-roller[bot] 3e12da8ed1 chore: bump chromium to 142.0.7444.23 (39-x-y) (#48307)
* chore: bump chromium in DEPS to 142.0.7432.2

* chore: bump chromium in DEPS to 142.0.7434.1

* chore: bump chromium in DEPS to 142.0.7436.1

* chore: bump chromium in DEPS to 142.0.7438.1

* chore: bump chromium in DEPS to 142.0.7440.1

* chore: bump chromium in DEPS to 142.0.7442.1

* chore: bump chromium in DEPS to 142.0.7444.1

* chore: bump chromium in DEPS to 142.0.7444.6

* chore: bump chromium in DEPS to 142.0.7444.3

* 6973697: Use type tags for data stored in V8 internal fields

https://chromium-review.googlesource.com/c/chromium/src/+/6973697

* chore: update patches

* chore: update filenames.libcxx.gni

* fix: parse macOS SDK version across line break
https://chromium-review.googlesource.com/c/chromium/src/+/6980166

(cherry picked from commit 2bcbb33de0)

* fix: replace v8::Object::SetPrototype() usage
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
https://github.com/nodejs/node/pull/55453

(cherry picked from commit c31b9ed5ac)

* fix: replace additional usages of SetPrototype
https://chromium-review.googlesource.com/c/v8/v8/+/6983465

(cherry picked from commit bf151e9d28520c7dd74cba62240acbcaaab5433d)

* fixup! fix: replace additional usages of SetPrototype https://chromium-review.googlesource.com/c/v8/v8/+/6983465

(cherry picked from commit f4434755b82b098e4d83d42bab26f183b6824f99)

* build: use macos 15 minimum
https://chromium-review.googlesource.com/c/chromium/src/+/6980166

(cherry picked from commit 4d2b5d7b2cf9a1786cdb1a77bf73e4ad0d3e45d1)

* fixup! build: use macos 15 minimum https://chromium-review.googlesource.com/c/chromium/src/+/6980166

(cherry picked from commit 94bb41a66330dcaf6b92c80cfefd72759405793d)

* ci: ignore missing dir for strip_universal_deep

(cherry picked from commit 634963f171bc5f6050151f76973e7ffbab0e00cf)

* chore: update patches

* chore: update patches

* chore: bump chromium in DEPS to 142.0.7444.23

* fix: disable C++ modules in electron_lib builds
https://chromium-review.googlesource.com/c/chromium/src/+/6950738

(cherry picked from commit 6207c79aec)

* Revert "build: use macos 15 minimum"

This reverts commit 2fc12d6acc.

Initially this change was made to test if it fixes libcxx
compilation issues. As that's now resolved by disabling libcxx
modules, this can be reverted.

(cherry picked from commit ad52007d5b)

* fix: js2c compilation failure

https://chromium-review.googlesource.com/c/chromium/src/+/6950738

See patch description explaining MacOS 26 SDK headers incompatibility.

(cherry picked from commit 39e2470875)

* fix: disable C++ modules in libnode builds

(cherry picked from commit fd0a7b61a1)

* fixup! fix: replace v8::Object::SetPrototype() usage https://chromium-review.googlesource.com/c/v8/v8/+/6983465 https://github.com/nodejs/node/pull/55453

(cherry picked from commit 2f52159b71)

* build: switch to macos-15 runner

build/mac/find_sdk.py now requires macOS 15 SDK as a minimum version. The
macos 15 runners default to an Xcode using the 15 SDK and removes older
versions.

(cherry picked from commit e368703f24)

* chore: update patches

* fix: partially revert is_headless_mode removal
https://chromium-review.googlesource.com/c/chromium/src/+/6955633

This patch should likely be reworked. For now, this partially reverts the
removal of a required class property to restore behavior.

(cherry picked from commit aff3bf9a24)

* 6938086: Rename native_widget_types.h -> native_ui_types.h | https://chromium-review.googlesource.com/c/chromium/src/+/6938086

(cherry picked from commit c95ac7bf2b)

* 6973697: Use type tags for data stored in V8 internal fields

https://chromium-review.googlesource.com/c/chromium/src/+/6973697

* fixup! fix: check new forced colors enum value https://chromium-review.googlesource.com/c/chromium/src/+/6944403

(cherry picked from commit 0829c74b2f)

* fix: check new forced colors enum value
https://chromium-review.googlesource.com/c/chromium/src/+/6944403

(cherry picked from commit d585879807)

* feat: add new memory-eviction exit reason
https://chromium-review.googlesource.com/c/chromium/src/+/6991933

(cherry picked from commit 6e63197a22)

* fix: views::NonClientFrameView -> views::FrameView
https://chromium-review.googlesource.com/c/chromium/src/+/7005027
https://chromium-review.googlesource.com/c/chromium/src/+/6966937

(cherry picked from commit 1e86b6ddfb)

* fix: migrate NetworkConditions -> MatchedNetworkConditions
https://chromium-review.googlesource.com/c/chromium/src/+/6827307

(cherry picked from commit 97100ac168)

* fix: provide DeviceEmulationCacheBehavior param
https://chromium-review.googlesource.com/c/chromium/src/+/6965238

(cherry picked from commit f9a08c5384)

* fix: add missing image_skia include
https://chromium-review.googlesource.com/c/chromium/src/+/6986762

(cherry picked from commit dd5eaf03fd)

* fixup! fix: add missing image_skia include https://chromium-review.googlesource.com/c/chromium/src/+/6986762

(cherry picked from commit 249c4d4de1)

* 6948286: [wasm-imported-strings] Drop feature flag

https://chromium-review.googlesource.com/c/v8/v8/+/6948286

* fix: disable protocol handler DCHECK

https://chromium-review.googlesource.com/c/chromium/src/+/6727594

Ignore the extension custom protocol handler registry DCHECK until
we invest in supporting it. Replacing this DCHECK seems harmless
and will unblock the roll.

(cherry picked from commit 019d3f0b09)

* 6986762: Remove some includes of //ui/gfx/image/image_skia.h

https: //chromium-review.googlesource.com/c/chromium/src/+/6986762

* fixup! fix: migrate NetworkConditions -> MatchedNetworkConditions https://chromium-review.googlesource.com/c/chromium/src/+/6827307

(cherry picked from commit a8f67f1ac3)

* fixup: 6986762: Remove some includes of //ui/gfx/image/image_skia.h

s

* fix: replace deprecated usage of SetPrototype
https://chromium-review.googlesource.com/c/v8/v8/+/6983465

(cherry picked from commit 5435d87b40)

* chore: restore electron embedder data tag patch

Co-Authored-By: Sam Maddock <sam@samuelmaddock.com>

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: Alice Zhao <alicelovescake@anthropic.com>
Co-authored-by: Sam Maddock <sam@samuelmaddock.com>
2025-10-14 11:25:30 -04:00

118 lines
3.8 KiB
C++

// Copyright (c) 2024 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_OSR_OSR_PAINT_EVENT_H
#define ELECTRON_SHELL_BROWSER_OSR_OSR_PAINT_EVENT_H
#include "base/functional/callback_helpers.h"
#include "content/public/common/widget_type.h"
#include "media/base/video_types.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/viz/privileged/mojom/compositing/frame_sink_video_capture.mojom.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/native_ui_types.h"
#include <cstdint>
namespace electron {
struct OffscreenNativePixmapPlaneInfo {
// The strides and offsets in bytes to be used when accessing the buffers
// via a memory mapping. One per plane per entry. Size in bytes of the
// plane is necessary to map the buffers.
uint32_t stride;
uint64_t offset;
uint64_t size;
// File descriptor for the underlying memory object (usually dmabuf).
int fd;
OffscreenNativePixmapPlaneInfo() = delete;
~OffscreenNativePixmapPlaneInfo();
OffscreenNativePixmapPlaneInfo(const OffscreenNativePixmapPlaneInfo& other);
OffscreenNativePixmapPlaneInfo(uint32_t stride,
uint64_t offset,
uint64_t size,
int fd);
};
struct OffscreenReleaserHolder {
OffscreenReleaserHolder() = delete;
~OffscreenReleaserHolder();
OffscreenReleaserHolder(
gfx::GpuMemoryBufferHandle gmb_handle,
mojo::PendingRemote<viz::mojom::FrameSinkVideoConsumerFrameCallbacks>
releaser);
// GpuMemoryBufferHandle, keep the scoped handle alive
gfx::GpuMemoryBufferHandle gmb_handle;
// Releaser, hold this to prevent FrameSinkVideoCapturer recycle frame
mojo::PendingRemote<viz::mojom::FrameSinkVideoConsumerFrameCallbacks>
releaser;
};
struct OffscreenSharedTextureValue {
OffscreenSharedTextureValue();
~OffscreenSharedTextureValue();
OffscreenSharedTextureValue(const OffscreenSharedTextureValue& other);
// It is user's responsibility to compose popup widget textures.
content::WidgetType widget_type;
// The pixel format of the shared texture, RGBA or BGRA depends on platform.
media::VideoPixelFormat pixel_format;
// The full dimensions of the video frame data.
gfx::Size coded_size;
// A subsection of [0, 0, coded_size().width(), coded_size.height()].
// In OSR case, it is expected to have the full area of the section.
gfx::Rect visible_rect;
// The region of the video frame that capturer would like to populate.
// In OSR case, it is the same with `dirtyRect` that needs to be painted.
gfx::Rect content_rect;
// Color space of the video frame.
gfx::ColorSpace color_space;
// Extra metadata for the video frame.
// See comments in src\media\base\video_frame_metadata.h for more details.
std::optional<gfx::Rect> capture_update_rect;
std::optional<gfx::Size> source_size;
std::optional<gfx::Rect> region_capture_rect;
// The capture timestamp, microseconds since capture start
int64_t timestamp;
// The frame count
int64_t frame_count;
// Releaser holder
raw_ptr<OffscreenReleaserHolder> releaser_holder;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
// On Windows it is a HANDLE to the shared D3D11 texture.
// On macOS it is a IOSurface* to the shared IOSurface.
uintptr_t shared_texture_handle;
#elif BUILDFLAG(IS_LINUX)
std::vector<OffscreenNativePixmapPlaneInfo> planes;
uint64_t modifier;
bool supports_zero_copy_webgpu_import;
#endif
};
typedef std::optional<OffscreenSharedTextureValue> OffscreenSharedTexture;
typedef base::RepeatingCallback<
void(const gfx::Rect&, const SkBitmap&, const OffscreenSharedTexture&)>
OnPaintCallback;
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_OSR_OSR_PAINT_EVENT_H