| Index: gpu/ipc/service/direct_composition_surface_win.h
|
| diff --git a/gpu/ipc/service/direct_composition_surface_win.h b/gpu/ipc/service/direct_composition_surface_win.h
|
| index f514f9c2d04aa85c935f9efc48b92bd6a578c389..22917e766259641937e01aeeefee92078f6ef641 100644
|
| --- a/gpu/ipc/service/direct_composition_surface_win.h
|
| +++ b/gpu/ipc/service/direct_composition_surface_win.h
|
| @@ -19,6 +19,8 @@
|
|
|
| namespace gpu {
|
|
|
| +class DCLayerTree;
|
| +
|
| class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL {
|
| public:
|
| DirectCompositionSurfaceWin(
|
| @@ -44,11 +46,6 @@ class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL {
|
| gfx::SwapResult SwapBuffers() override;
|
| gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override;
|
| gfx::VSyncProvider* GetVSyncProvider() override;
|
| - bool ScheduleOverlayPlane(int z_order,
|
| - gfx::OverlayTransform transform,
|
| - gl::GLImage* image,
|
| - const gfx::Rect& bounds_rect,
|
| - const gfx::RectF& crop_rect) override;
|
| bool SetEnableDCLayers(bool enable) override;
|
| bool FlipsVertically() const override;
|
| bool SupportsPostSubBuffer() override;
|
| @@ -57,10 +54,21 @@ class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL {
|
| bool SetDrawRectangle(const gfx::Rect& rect) override;
|
| gfx::Vector2d GetDrawOffset() const override;
|
|
|
| + // This schedules an overlay plane to be displayed on the next SwapBuffers
|
| + // or PostSubBuffer call. Overlay planes must be scheduled before every swap
|
| + // to remain in the layer tree. This surface's backbuffer doesn't have to be
|
| + // scheduled with ScheduleDCLayer, as it's automatically placed in the layer
|
| + // tree at z-order 0.
|
| + bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override;
|
| +
|
| bool Initialize(std::unique_ptr<gfx::VSyncProvider> vsync_provider);
|
|
|
| + const base::win::ScopedComPtr<IDCompositionSurface>& dcomp_surface() const {
|
| + return dcomp_surface_;
|
| + }
|
| +
|
| scoped_refptr<base::TaskRunner> GetWindowTaskRunnerForTesting();
|
| - base::win::ScopedComPtr<IDXGISwapChain1> swap_chain() const {
|
| + const base::win::ScopedComPtr<IDXGISwapChain1>& swap_chain() const {
|
| return swap_chain_;
|
| }
|
|
|
| @@ -68,24 +76,6 @@ class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL {
|
| ~DirectCompositionSurfaceWin() override;
|
|
|
| private:
|
| - struct Overlay {
|
| - Overlay(int z_order,
|
| - gfx::OverlayTransform transform,
|
| - scoped_refptr<gl::GLImage> image,
|
| - gfx::Rect bounds_rect,
|
| - gfx::RectF crop_rect);
|
| - Overlay(const Overlay& overlay);
|
| -
|
| - ~Overlay();
|
| -
|
| - int z_order;
|
| - gfx::OverlayTransform transform;
|
| - scoped_refptr<gl::GLImage> image;
|
| - gfx::Rect bounds_rect;
|
| - gfx::RectF crop_rect;
|
| - };
|
| -
|
| - bool CommitAndClearPendingOverlays();
|
| void ReleaseCurrentSurface();
|
| void InitializeSurface();
|
| // Release the texture that's currently being drawn to. If will_discard is
|
| @@ -107,15 +97,12 @@ class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL {
|
| bool first_swap_ = true;
|
| bool enable_dc_layers_ = false;
|
| std::unique_ptr<gfx::VSyncProvider> vsync_provider_;
|
| - std::vector<Overlay> pending_overlays_;
|
| gfx::Rect swap_rect_;
|
| -
|
| + std::unique_ptr<DCLayerTree> layer_tree_;
|
| gfx::Vector2d draw_offset_;
|
|
|
| base::win::ScopedComPtr<ID3D11Device> d3d11_device_;
|
| base::win::ScopedComPtr<IDCompositionDevice2> dcomp_device_;
|
| - base::win::ScopedComPtr<IDCompositionTarget> dcomp_target_;
|
| - base::win::ScopedComPtr<IDCompositionVisual2> visual_;
|
| base::win::ScopedComPtr<IDCompositionSurface> dcomp_surface_;
|
| base::win::ScopedComPtr<IDXGISwapChain1> swap_chain_;
|
| base::win::ScopedComPtr<ID3D11Texture2D> draw_texture_;
|
|
|