Skip to content

Commit

Permalink
gpu: win: Replace root GLSurface with SharedImage DComp overlay
Browse files Browse the repository at this point in the history
Implement SkiaOutputDeviceDCompPresenter, which owns a SharedImage for
use as the root surface. This is in contrast with
DirectCompositionSurfaceWin, which is a GLSurface that owns the back
buffer.

The plan is to have both SkiaOutputDeviceDComp implementations
selectable with a feature flag. Then, after experimentation with
DCompPresenter, we will remove the feature flag,
DirectComposition[Child]SurfaceWin (and related types) and merge
SkiaOutputDeviceDCompPresenter with SkiaOutputDeviceDComp.

Removal of DirectComposition[Child]SurfaceWin will allow many
Windows-specific functions on GLSurface be removed (and may help
GLSurface itself be removed).

Bug: 1378741
Change-Id: Ia2215e1289b926a7696c535ec03781c2028da53b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3984093
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096558}
  • Loading branch information
tangm-msft authored and Chromium LUCI CQ committed Jan 25, 2023
1 parent 34ccdb1 commit 264e7d5
Show file tree
Hide file tree
Showing 12 changed files with 948 additions and 156 deletions.
7 changes: 7 additions & 0 deletions components/viz/service/BUILD.gn
Expand Up @@ -563,9 +563,16 @@ viz_source_set("unit_tests") {
sources += [
"display/overlay_dc_unittest.cc",
"display_embedder/output_device_backing_unittest.cc",
"display_embedder/skia_output_device_dcomp_unittest.cc",
"display_embedder/software_output_device_win_unittest.cc",
]

deps += [
"//ui/gl:test_support",
"//ui/platform_window",
"//ui/platform_window/win",
]

# SkiaOutputDeviceBufferQueue doesn't support Windows.
sources -=
[ "display_embedder/skia_output_device_buffer_queue_unittest.cc" ]
Expand Down
5 changes: 3 additions & 2 deletions components/viz/service/display_embedder/skia_output_device.h
Expand Up @@ -18,6 +18,7 @@
#include "components/viz/service/display/output_surface_frame.h"
#include "components/viz/service/display/overlay_processor_interface.h"
#include "components/viz/service/display/skia_output_surface.h"
#include "components/viz/service/viz_service_export.h"
#include "gpu/command_buffer/common/swap_buffers_complete_params.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/skia/include/core/SkRefCnt.h"
Expand Down Expand Up @@ -50,10 +51,10 @@ namespace viz {

class VulkanContextProvider;

class SkiaOutputDevice {
class VIZ_SERVICE_EXPORT SkiaOutputDevice {
public:
// A helper class for defining a BeginPaint() and EndPaint() scope.
class ScopedPaint {
class VIZ_SERVICE_EXPORT ScopedPaint {
public:
ScopedPaint(std::vector<GrBackendSemaphore> end_semaphores,
SkiaOutputDevice* device,
Expand Down

0 comments on commit 264e7d5

Please sign in to comment.