Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Unified Diff: gpu/ipc/service/direct_composition_surface_win.h

Issue 2749023011: Add DirectComposition overlay support. (Closed)
Patch Set: post-review changes Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..eea230d042cc389373bd9faeddfcdaca75bac05c 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,9 +53,14 @@ 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);
+ base::win::ScopedComPtr<IDCompositionSurface> dcomp_surface() const {
sunnyps 2017/03/28 22:28:59 nit: return const ref here
+ return dcomp_surface_;
+ }
+
scoped_refptr<base::TaskRunner> GetWindowTaskRunnerForTesting();
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_;

Powered by Google App Engine
This is Rietveld 408576698