|
@@ -8,13 +8,13 @@ rendering with the viz compositor by way of a custom HostDisplayClient
|
|
|
and LayeredWindowUpdater.
|
|
|
|
|
|
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
|
|
|
-index 3547ee865c22..715bfa4b5db5 100644
|
|
|
+index 3547ee865c220731a6b4be4c1b32ec899b3dd11f..715bfa4b5db5fc4beb83c26b1eedda82c87a245b 100644
|
|
|
--- a/components/viz/host/host_display_client.cc
|
|
|
+++ b/components/viz/host/host_display_client.cc
|
|
|
@@ -43,9 +43,13 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
+
|
|
|
-#if defined(OS_WIN)
|
|
|
+void HostDisplayClient::IsOffscreen(IsOffscreenCallback callback) {
|
|
|
+ std::move(callback).Run(false);
|
|
@@ -27,7 +27,7 @@ index 3547ee865c22..715bfa4b5db5 100644
|
|
|
DLOG(ERROR) << "HWND shouldn't be using a layered window";
|
|
|
return;
|
|
|
@@ -53,8 +57,12 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
|
|
|
-
|
|
|
+
|
|
|
layered_window_updater_ =
|
|
|
std::make_unique<LayeredWindowUpdaterImpl>(widget_, std::move(receiver));
|
|
|
-}
|
|
@@ -37,17 +37,17 @@ index 3547ee865c22..715bfa4b5db5 100644
|
|
|
+ "Electron's OSR implementation.";
|
|
|
#endif
|
|
|
+}
|
|
|
-
|
|
|
+
|
|
|
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
|
|
void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
|
|
|
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
|
|
|
-index cedf833d2358..4437a7875076 100644
|
|
|
+index cedf833d23589dc3157168cfc7e6d3bb12939f7a..4437a7875076ef5a99ddcd767036ec37c2d48d44 100644
|
|
|
--- a/components/viz/host/host_display_client.h
|
|
|
+++ b/components/viz/host/host_display_client.h
|
|
|
@@ -31,17 +31,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
|
|
|
mojo::PendingRemote<mojom::DisplayClient> GetBoundRemote(
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
|
|
-
|
|
|
+
|
|
|
- private:
|
|
|
+ protected:
|
|
|
// mojom::DisplayClient implementation:
|
|
@@ -57,31 +57,31 @@ index cedf833d2358..4437a7875076 100644
|
|
|
void OnDisplayReceivedCALayerParams(
|
|
|
const gfx::CALayerParams& ca_layer_params) override;
|
|
|
#endif
|
|
|
-
|
|
|
+
|
|
|
-#if defined(OS_WIN)
|
|
|
void CreateLayeredWindowUpdater(
|
|
|
mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) override;
|
|
|
-#endif
|
|
|
-
|
|
|
+
|
|
|
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
|
|
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
|
|
|
diff --git a/components/viz/host/layered_window_updater_impl.cc b/components/viz/host/layered_window_updater_impl.cc
|
|
|
-index b04f654fe820..ee22012b01ef 100644
|
|
|
+index b04f654fe820f821b18e059cdd40085fc2384c4e..ee22012b01ef92bb3b32b5b1081609a7bdfb0d93 100644
|
|
|
--- a/components/viz/host/layered_window_updater_impl.cc
|
|
|
+++ b/components/viz/host/layered_window_updater_impl.cc
|
|
|
@@ -44,7 +44,9 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory(
|
|
|
// |region|'s handle will close when it goes out of scope.
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
-void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) {
|
|
|
+void LayeredWindowUpdaterImpl::Draw(
|
|
|
+ const gfx::Rect& damage_rect,
|
|
|
+ DrawCallback draw_callback) {
|
|
|
TRACE_EVENT0("viz", "LayeredWindowUpdaterImpl::Draw");
|
|
|
-
|
|
|
+
|
|
|
if (!canvas_) {
|
|
|
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
|
|
|
-index 1026b739d283..fe562ab60ce9 100644
|
|
|
+index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb319a4dd04 100644
|
|
|
--- a/components/viz/host/layered_window_updater_impl.h
|
|
|
+++ b/components/viz/host/layered_window_updater_impl.h
|
|
|
@@ -35,7 +35,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
|
|
@@ -90,11 +90,11 @@ index 1026b739d283..fe562ab60ce9 100644
|
|
|
base::UnsafeSharedMemoryRegion region) override;
|
|
|
- void Draw(DrawCallback draw_callback) override;
|
|
|
+ void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override;
|
|
|
-
|
|
|
+
|
|
|
private:
|
|
|
const HWND hwnd_;
|
|
|
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
|
|
-index 7a1277ad28ed..d09e6480b18d 100644
|
|
|
+index 5cd92d7a38ee19fedce90976a898f0c312f7d908..4dea0a7721352865f463fad971c56f7f8c400f66 100644
|
|
|
--- a/components/viz/service/BUILD.gn
|
|
|
+++ b/components/viz/service/BUILD.gn
|
|
|
@@ -111,6 +111,8 @@ viz_component("service") {
|
|
@@ -107,7 +107,7 @@ index 7a1277ad28ed..d09e6480b18d 100644
|
|
|
"display_embedder/software_output_surface.h",
|
|
|
"display_embedder/viz_process_context_provider.cc",
|
|
|
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
|
|
-index 97feccc71b94..c267d1e72ec6 100644
|
|
|
+index 8e29d3218851fa0395815fe10f8f7276d6ead3f1..5eb5b84cf816e487eacbace80990f2dc68b662af 100644
|
|
|
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
|
|
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
|
|
@@ -21,6 +21,7 @@
|
|
@@ -126,10 +126,10 @@ index 97feccc71b94..c267d1e72ec6 100644
|
|
|
#include "ui/base/ui_base_switches.h"
|
|
|
#include "ui/gl/gl_context.h"
|
|
|
#include "ui/gl/init/gl_factory.h"
|
|
|
-@@ -242,6 +244,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
|
|
+@@ -225,6 +227,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
|
|
if (headless_)
|
|
|
return std::make_unique<SoftwareOutputDevice>();
|
|
|
-
|
|
|
+
|
|
|
+#if !defined(OS_MACOSX)
|
|
|
+ {
|
|
|
+ mojo::ScopedAllowSyncCallForTesting allow_sync;
|
|
@@ -150,11 +150,11 @@ index 97feccc71b94..c267d1e72ec6 100644
|
|
|
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
|
|
|
display_client);
|
|
|
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
|
|
|
-index b9357082293c..b4cb07e26d15 100644
|
|
|
+index 49149081cc603f14eacee647cbb2fcf8ed5e66fd..9ff3f2ee203403fdaa31edb8a0bcc000c4d214d7 100644
|
|
|
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
|
|
|
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
|
|
|
@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
|
|
|
-
|
|
|
+
|
|
|
SkCanvas* SoftwareOutputDeviceMac::BeginPaint(
|
|
|
const gfx::Rect& new_damage_rect) {
|
|
|
+ last_damage = new_damage_rect;
|
|
@@ -162,7 +162,7 @@ index b9357082293c..b4cb07e26d15 100644
|
|
|
// Record the previous paint buffer.
|
|
|
Buffer* previous_paint_buffer =
|
|
|
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
|
|
|
-@@ -184,6 +186,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
|
|
+@@ -187,6 +189,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
|
|
ca_layer_params.is_empty = false;
|
|
|
ca_layer_params.scale_factor = scale_factor_;
|
|
|
ca_layer_params.pixel_size = pixel_size_;
|
|
@@ -171,20 +171,20 @@ index b9357082293c..b4cb07e26d15 100644
|
|
|
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
|
|
|
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
|
|
|
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
|
|
|
-index f3867356e3d6..b1d192d2b20c 100644
|
|
|
+index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e5ffe86dd 100644
|
|
|
--- a/components/viz/service/display_embedder/software_output_device_mac.h
|
|
|
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
|
|
|
@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
|
|
|
void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer,
|
|
|
const SkRegion& new_damage_rect);
|
|
|
-
|
|
|
+
|
|
|
+ gfx::Rect last_damage;
|
|
|
gfx::Size pixel_size_;
|
|
|
float scale_factor_ = 1;
|
|
|
-
|
|
|
+
|
|
|
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
|
|
new file mode 100644
|
|
|
-index 000000000000..4efea02f80f8
|
|
|
+index 0000000000000000000000000000000000000000..4efea02f80f8b6818291321a7c63f0f4815a5b98
|
|
|
--- /dev/null
|
|
|
+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
|
|
@@ -0,0 +1,157 @@
|
|
@@ -347,7 +347,7 @@ index 000000000000..4efea02f80f8
|
|
|
+} // namespace viz
|
|
|
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h
|
|
|
new file mode 100644
|
|
|
-index 000000000000..48fa86caaab3
|
|
|
+index 0000000000000000000000000000000000000000..48fa86caaab3c15764f105eb7ad2aecf2b89bf36
|
|
|
--- /dev/null
|
|
|
+++ b/components/viz/service/display_embedder/software_output_device_proxy.h
|
|
|
@@ -0,0 +1,90 @@
|
|
@@ -442,61 +442,81 @@ index 000000000000..48fa86caaab3
|
|
|
+
|
|
|
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
|
|
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
|
|
|
-index bb07c338fac5..e0ebb98d9a02 100644
|
|
|
+index 94ea55487f85ab32d862e913c476bc95f388dce9..d055a18bbc186facd88d496d589be78068c4ca64 100644
|
|
|
--- a/components/viz/service/display_embedder/software_output_device_win.cc
|
|
|
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
|
|
|
@@ -268,7 +268,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
|
|
if (!canvas_)
|
|
|
return;
|
|
|
-
|
|
|
+
|
|
|
- layered_window_updater_->Draw(base::BindOnce(
|
|
|
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
|
|
&SoftwareOutputDeviceWinProxy::DrawAck, base::Unretained(this)));
|
|
|
waiting_on_draw_ack_ = true;
|
|
|
-
|
|
|
+
|
|
|
+diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
|
|
|
+index 8e10af98f2b039d0d96f8be908f751b9117193d5..f9501da88a008131e3d046b452ba9c34455a1da4 100644
|
|
|
+--- a/content/browser/compositor/viz_process_transport_factory.cc
|
|
|
++++ b/content/browser/compositor/viz_process_transport_factory.cc
|
|
|
+@@ -404,8 +404,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
|
|
+ compositor_data.display_private.reset();
|
|
|
+ root_params->display_private =
|
|
|
+ compositor_data.display_private.BindNewEndpointAndPassReceiver();
|
|
|
+- compositor_data.display_client =
|
|
|
+- std::make_unique<HostDisplayClient>(compositor);
|
|
|
++ if (compositor->delegate()) {
|
|
|
++ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient(
|
|
|
++ compositor);
|
|
|
++ } else {
|
|
|
++ compositor_data.display_client =
|
|
|
++ std::make_unique<HostDisplayClient>(compositor);
|
|
|
++ }
|
|
|
+ root_params->display_client =
|
|
|
+ compositor_data.display_client->GetBoundRemote(resize_task_runner_);
|
|
|
+
|
|
|
diff --git a/mojo/public/cpp/bindings/sync_call_restrictions.h b/mojo/public/cpp/bindings/sync_call_restrictions.h
|
|
|
-index ac94eab98fd0..b89d52a0c869 100644
|
|
|
+index 60e1149205750740ab5bde81029e7e3b370bd1ed..abfb772cd318b4cca3aed167a8808839d947f896 100644
|
|
|
--- a/mojo/public/cpp/bindings/sync_call_restrictions.h
|
|
|
+++ b/mojo/public/cpp/bindings/sync_call_restrictions.h
|
|
|
-@@ -29,6 +29,7 @@ class HostContextFactoryPrivate;
|
|
|
-
|
|
|
+@@ -29,6 +29,7 @@ class Compositor;
|
|
|
+
|
|
|
namespace viz {
|
|
|
class HostFrameSinkManager;
|
|
|
+class GpuDisplayProvider;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
namespace mojo {
|
|
|
-@@ -82,6 +83,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
|
|
|
- // For preventing frame swaps of wrong size during resize on Windows.
|
|
|
- // (https://crbug.com/811945)
|
|
|
- friend class ui::HostContextFactoryPrivate;
|
|
|
+@@ -79,6 +80,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
|
|
|
+ // For destroying the GL context/surface that draw to a platform window before
|
|
|
+ // the platform window is destroyed.
|
|
|
+ friend class viz::HostFrameSinkManager;
|
|
|
+ // For query of whether to use SoftwareOutputDevice or not
|
|
|
+ friend class viz::GpuDisplayProvider;
|
|
|
- // END ALLOWED USAGE.
|
|
|
-
|
|
|
- #if ENABLE_SYNC_CALL_RESTRICTIONS
|
|
|
+ // For preventing frame swaps of wrong size during resize on Windows.
|
|
|
+ // (https://crbug.com/811945)
|
|
|
+ friend class ui::Compositor;
|
|
|
diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom
|
|
|
-index 609ded904478..2e6a7c8808d3 100644
|
|
|
+index d36f62e6ee4166f0e27f6534c804430374bfa298..6575d7e6cafdca8cdc172e0f9912648570c1deeb 100644
|
|
|
--- a/services/viz/privileged/mojom/compositing/display_private.mojom
|
|
|
+++ b/services/viz/privileged/mojom/compositing/display_private.mojom
|
|
|
-@@ -75,12 +75,14 @@ interface DisplayPrivate {
|
|
|
+@@ -74,12 +74,14 @@ interface DisplayPrivate {
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
interface DisplayClient {
|
|
|
+ [Sync]
|
|
|
+ IsOffscreen() => (bool success);
|
|
|
+
|
|
|
[EnableIf=is_mac]
|
|
|
OnDisplayReceivedCALayerParams(gfx.mojom.CALayerParams ca_layer_params);
|
|
|
-
|
|
|
+
|
|
|
// Creates a LayeredWindowUpdater implementation to draw into a layered
|
|
|
// window.
|
|
|
- [EnableIf=is_win]
|
|
|
CreateLayeredWindowUpdater(pending_receiver<LayeredWindowUpdater> receiver);
|
|
|
-
|
|
|
+
|
|
|
// Notifies that a swap has occurred and provides information about the pixel
|
|
|
diff --git a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
|
|
-index 6b7fbb6cf13d..e2af75168cb9 100644
|
|
|
+index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a285498c3f8e72 100644
|
|
|
--- a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
|
|
+++ b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
|
|
@@ -26,5 +26,5 @@ interface LayeredWindowUpdater {
|
|
@@ -507,21 +527,21 @@ index 6b7fbb6cf13d..e2af75168cb9 100644
|
|
|
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
|
|
};
|
|
|
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
|
|
-index 443406844ecf..0b4ca067fe1e 100644
|
|
|
+index 3e2d2304faf75d1ec6cc830d756cbf31767dacfd..b4ec5b6e34f901ace7975e5e906e01177f04e8be 100644
|
|
|
--- a/ui/compositor/compositor.h
|
|
|
+++ b/ui/compositor/compositor.h
|
|
|
-@@ -66,6 +66,7 @@ class GpuMemoryBufferManager;
|
|
|
-
|
|
|
- namespace viz {
|
|
|
+@@ -70,6 +70,7 @@ class DisplayPrivate;
|
|
|
+ class ExternalBeginFrameController;
|
|
|
+ } // namespace mojom
|
|
|
class ContextProvider;
|
|
|
+class HostDisplayClient;
|
|
|
class HostFrameSinkManager;
|
|
|
class LocalSurfaceIdAllocation;
|
|
|
class RasterContextProvider;
|
|
|
-@@ -166,6 +167,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
|
|
- virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0;
|
|
|
+@@ -122,6 +123,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
|
|
+ virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
+class COMPOSITOR_EXPORT CompositorDelegate {
|
|
|
+ public:
|
|
|
+ virtual std::unique_ptr<viz::HostDisplayClient> CreateHostDisplayClient(
|
|
@@ -534,68 +554,48 @@ index 443406844ecf..0b4ca067fe1e 100644
|
|
|
// Compositor object to take care of GPU painting.
|
|
|
// A Browser compositor object is responsible for generating the final
|
|
|
// displayable form of pixels comprising a single widget's contents. It draws an
|
|
|
-@@ -205,6 +215,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
|
|
+@@ -155,6 +165,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
|
|
// Schedules a redraw of the layer tree associated with this compositor.
|
|
|
void ScheduleDraw();
|
|
|
-
|
|
|
+
|
|
|
+ CompositorDelegate* delegate() const { return delegate_; }
|
|
|
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
|
|
|
+
|
|
|
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
|
|
// must have no parent. The compositor's root layer is reset if the root layer
|
|
|
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
|
|
-@@ -422,6 +435,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
|
|
- ui::ContextFactory* context_factory_;
|
|
|
- ui::ContextFactoryPrivate* context_factory_private_;
|
|
|
-
|
|
|
+@@ -390,6 +403,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
|
|
+
|
|
|
+ std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;
|
|
|
+
|
|
|
+ CompositorDelegate* delegate_ = nullptr;
|
|
|
+
|
|
|
// The root of the Layer tree drawn by this compositor.
|
|
|
Layer* root_layer_ = nullptr;
|
|
|
-
|
|
|
-diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc
|
|
|
-index 1db09f76243c..f07cd7a5098b 100644
|
|
|
---- a/ui/compositor/host/host_context_factory_private.cc
|
|
|
-+++ b/ui/compositor/host/host_context_factory_private.cc
|
|
|
-@@ -112,8 +112,13 @@ void HostContextFactoryPrivate::ConfigureCompositor(
|
|
|
- compositor_data.display_private.reset();
|
|
|
- root_params->display_private =
|
|
|
- compositor_data.display_private.BindNewEndpointAndPassReceiver();
|
|
|
-- compositor_data.display_client =
|
|
|
-- std::make_unique<HostDisplayClient>(compositor);
|
|
|
-+ if (compositor->delegate()) {
|
|
|
-+ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient(
|
|
|
-+ compositor);
|
|
|
-+ } else {
|
|
|
-+ compositor_data.display_client =
|
|
|
-+ std::make_unique<HostDisplayClient>(compositor);
|
|
|
-+ }
|
|
|
- root_params->display_client =
|
|
|
- compositor_data.display_client->GetBoundRemote(resize_task_runner_);
|
|
|
-
|
|
|
+
|
|
|
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
|
|
|
-index 4014e64a75da..25e57784e1a1 100644
|
|
|
+index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059c468432f 100644
|
|
|
--- a/ui/gfx/ca_layer_params.h
|
|
|
+++ b/ui/gfx/ca_layer_params.h
|
|
|
@@ -6,6 +6,7 @@
|
|
|
#define UI_GFX_CA_LAYER_PARAMS_H_
|
|
|
-
|
|
|
+
|
|
|
#include "build/build_config.h"
|
|
|
+#include "ui/gfx/geometry/rect.h"
|
|
|
#include "ui/gfx/geometry/size.h"
|
|
|
#include "ui/gfx/gfx_export.h"
|
|
|
-
|
|
|
+
|
|
|
@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams {
|
|
|
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
|
|
|
#endif
|
|
|
-
|
|
|
+
|
|
|
+ gfx::Rect damage;
|
|
|
+
|
|
|
// The geometry of the frame.
|
|
|
gfx::Size pixel_size;
|
|
|
float scale_factor = 1.f;
|
|
|
diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom
|
|
|
-index a73b2e678ffe..6c36626d204c 100644
|
|
|
+index de00e766ba17532e10dcf5d0fd31fa344920a9f7..7aaedf83ad22dcc1d2dd39a31cf7e08b7b6ba4d3 100644
|
|
|
--- a/ui/gfx/mojom/ca_layer_params.mojom
|
|
|
+++ b/ui/gfx/mojom/ca_layer_params.mojom
|
|
|
@@ -18,5 +18,6 @@ struct CALayerParams {
|
|
@@ -606,13 +606,13 @@ index a73b2e678ffe..6c36626d204c 100644
|
|
|
float scale_factor;
|
|
|
};
|
|
|
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
|
|
-index 843d5c24ec33..0ea594950fcd 100644
|
|
|
+index 3f050fcf52ebb2dc2a5510d9489255ee22bfbcc8..61383dbed35dc72060a1e422fd68437fa4729ce3 100644
|
|
|
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
|
|
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
|
|
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
|
|
|
if (!data.ReadPixelSize(&out->pixel_size))
|
|
|
return false;
|
|
|
-
|
|
|
+
|
|
|
+ if (!data.ReadDamage(&out->damage))
|
|
|
+ return false;
|
|
|
+
|
|
@@ -620,13 +620,13 @@ index 843d5c24ec33..0ea594950fcd 100644
|
|
|
return true;
|
|
|
}
|
|
|
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
|
|
-index 4cac766eae31..0821495ad229 100644
|
|
|
+index 4cac766eae3161baedac4202f694129cd90c80de..0821495ad22944d8856bb750cac8912a2f8328c3 100644
|
|
|
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
|
|
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
|
|
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
|
|
|
return ca_layer_params.pixel_size;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ static gfx::Rect damage(const gfx::CALayerParams& ca_layer_params) {
|
|
|
+ return ca_layer_params.damage;
|
|
|
+ }
|