77 lines
3.7 KiB
Diff
77 lines
3.7 KiB
Diff
From: uazo <uazo@users.noreply.github.com>
|
|
Date: Wed, 29 Oct 2025 12:30:49 +0000
|
|
Subject: Temp use PREVIEW for IDCompositionDevice5
|
|
|
|
Temporarily restore the statement from v141 while waiting to update the Windows SDK.
|
|
See Remove preview usage of DynamicTexture DComp APIs.
|
|
https://chromium-review.googlesource.com/c/chromium/src/+/6902339
|
|
|
|
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
|
---
|
|
.../viz/service/display_embedder/skia_output_device_dcomp.cc | 3 ++-
|
|
ui/gl/dc_layer_tree.cc | 3 ++-
|
|
ui/gl/dc_layer_tree.h | 3 ++-
|
|
3 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/components/viz/service/display_embedder/skia_output_device_dcomp.cc b/components/viz/service/display_embedder/skia_output_device_dcomp.cc
|
|
--- a/components/viz/service/display_embedder/skia_output_device_dcomp.cc
|
|
+++ b/components/viz/service/display_embedder/skia_output_device_dcomp.cc
|
|
@@ -26,6 +26,7 @@
|
|
#include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
|
|
#include "gpu/command_buffer/service/skia_utils.h"
|
|
#include "gpu/command_buffer/service/texture_manager.h"
|
|
+#include "third_party/microsoft_dxheaders/src/include/composition/dcomp-preview.h"
|
|
#include "third_party/skia/include/core/SkCanvas.h"
|
|
#include "third_party/skia/include/core/SkSurface.h"
|
|
#include "third_party/skia/include/gpu/ganesh/GrDirectContext.h"
|
|
@@ -59,7 +60,7 @@ OutputSurface::DCSupportLevel GetDcSupportLevel() {
|
|
Microsoft::WRL::ComPtr<IDCompositionDevice3> dcomp_device =
|
|
gl::GetDirectCompositionDevice();
|
|
|
|
- if (Microsoft::WRL::ComPtr<IDCompositionDevice5> dcomp_device5;
|
|
+ if (Microsoft::WRL::ComPtr<PREVIEW_IDCompositionDevice5> dcomp_device5;
|
|
SUCCEEDED(dcomp_device.As(&dcomp_device5))) {
|
|
return OutputSurface::DCSupportLevel::kDCompDynamicTexture;
|
|
}
|
|
diff --git a/ui/gl/dc_layer_tree.cc b/ui/gl/dc_layer_tree.cc
|
|
--- a/ui/gl/dc_layer_tree.cc
|
|
+++ b/ui/gl/dc_layer_tree.cc
|
|
@@ -17,6 +17,7 @@
|
|
#include "base/trace_event/trace_event.h"
|
|
#include "base/types/expected.h"
|
|
#include "base/types/expected_macros.h"
|
|
+#include "third_party/microsoft_dxheaders/src/include/composition/dcomp-preview.h"
|
|
#include "ui/gfx/color_space_win.h"
|
|
#include "ui/gfx/geometry/rect_conversions.h"
|
|
#include "ui/gfx/geometry/transform_util.h"
|
|
@@ -384,7 +385,7 @@ void DCLayerTree::Initialize(
|
|
|
|
hdr_metadata_helper_ = std::make_unique<HDRMetadataHelperWin>(d3d11_device_);
|
|
|
|
- if (Microsoft::WRL::ComPtr<IDCompositionDevice5> dcomp_device5;
|
|
+ if (Microsoft::WRL::ComPtr<PREVIEW_IDCompositionDevice5> dcomp_device5;
|
|
SUCCEEDED(dcomp_device_.As(&dcomp_device5))) {
|
|
hr = dcomp_device5->CreateDynamicTexture(&primary_plane_surface_);
|
|
if (FAILED(hr)) {
|
|
diff --git a/ui/gl/dc_layer_tree.h b/ui/gl/dc_layer_tree.h
|
|
--- a/ui/gl/dc_layer_tree.h
|
|
+++ b/ui/gl/dc_layer_tree.h
|
|
@@ -18,6 +18,7 @@
|
|
#include "base/moving_window.h"
|
|
#include "base/types/expected.h"
|
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
|
+#include "third_party/microsoft_dxheaders/src/include/composition/dcomp-preview.h"
|
|
#include "ui/gfx/geometry/size.h"
|
|
#include "ui/gfx/overlay_layer_id.h"
|
|
#include "ui/gl/dc_layer_overlay_params.h"
|
|
@@ -555,7 +556,7 @@ class GL_EXPORT DCLayerTree {
|
|
|
|
// If supported, a surface that is updated with the contents of the primary
|
|
// plane. If not supported, null.
|
|
- Microsoft::WRL::ComPtr<IDCompositionDynamicTexture> primary_plane_surface_;
|
|
+ Microsoft::WRL::ComPtr<PREVIEW_IDCompositionDynamicTexture> primary_plane_surface_;
|
|
|
|
// This is a number that increments once every time `primary_plane_surface_`
|
|
// is updated, and is used to determine when the contents have changed so
|
|
--
|