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..76e60f3f963d9a86e0d8a8c02afeae881d24d242 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; |
@@ -56,11 +53,16 @@ class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL { |
bool SupportsDCLayers() const override; |
bool SetDrawRectangle(const gfx::Rect& rect) override; |
gfx::Vector2d GetDrawOffset() const override; |
+ 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 +70,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 +91,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_; |