OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ | 5 #ifndef GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ |
6 #define GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ | 6 #define GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ |
7 | 7 |
8 #include <d3d11.h> | 8 #include <d3d11.h> |
9 #include <dcomp.h> | 9 #include <dcomp.h> |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // This is a placeholder surface used when not rendering to the | 99 // This is a placeholder surface used when not rendering to the |
100 // DirectComposition surface. | 100 // DirectComposition surface. |
101 EGLSurface default_surface_ = 0; | 101 EGLSurface default_surface_ = 0; |
102 | 102 |
103 // This is the real surface representing the backbuffer. It may be null | 103 // This is the real surface representing the backbuffer. It may be null |
104 // outside of a BeginDraw/EndDraw pair. | 104 // outside of a BeginDraw/EndDraw pair. |
105 EGLSurface real_surface_ = 0; | 105 EGLSurface real_surface_ = 0; |
106 gfx::Size size_ = gfx::Size(1, 1); | 106 gfx::Size size_ = gfx::Size(1, 1); |
107 bool first_swap_ = true; | 107 bool first_swap_ = true; |
108 bool enable_dc_layers_ = false; | 108 bool enable_dc_layers_ = false; |
| 109 bool has_alpha_ = true; |
109 std::unique_ptr<gfx::VSyncProvider> vsync_provider_; | 110 std::unique_ptr<gfx::VSyncProvider> vsync_provider_; |
110 std::vector<Overlay> pending_overlays_; | 111 std::vector<Overlay> pending_overlays_; |
111 gfx::Rect swap_rect_; | 112 gfx::Rect swap_rect_; |
112 | 113 |
113 gfx::Vector2d draw_offset_; | 114 gfx::Vector2d draw_offset_; |
114 | 115 |
115 base::win::ScopedComPtr<ID3D11Device> d3d11_device_; | 116 base::win::ScopedComPtr<ID3D11Device> d3d11_device_; |
116 base::win::ScopedComPtr<IDCompositionDevice2> dcomp_device_; | 117 base::win::ScopedComPtr<IDCompositionDevice2> dcomp_device_; |
117 base::win::ScopedComPtr<IDCompositionTarget> dcomp_target_; | 118 base::win::ScopedComPtr<IDCompositionTarget> dcomp_target_; |
118 base::win::ScopedComPtr<IDCompositionVisual2> visual_; | 119 base::win::ScopedComPtr<IDCompositionVisual2> visual_; |
119 base::win::ScopedComPtr<IDCompositionSurface> dcomp_surface_; | 120 base::win::ScopedComPtr<IDCompositionSurface> dcomp_surface_; |
120 base::win::ScopedComPtr<IDXGISwapChain1> swap_chain_; | 121 base::win::ScopedComPtr<IDXGISwapChain1> swap_chain_; |
121 base::win::ScopedComPtr<ID3D11Texture2D> draw_texture_; | 122 base::win::ScopedComPtr<ID3D11Texture2D> draw_texture_; |
122 | 123 |
123 // Keep track of whether the texture has been rendered to, as the first draw | 124 // Keep track of whether the texture has been rendered to, as the first draw |
124 // to it must overwrite the entire thing. | 125 // to it must overwrite the entire thing. |
125 bool has_been_rendered_to_ = false; | 126 bool has_been_rendered_to_ = false; |
126 | 127 |
127 DISALLOW_COPY_AND_ASSIGN(DirectCompositionSurfaceWin); | 128 DISALLOW_COPY_AND_ASSIGN(DirectCompositionSurfaceWin); |
128 }; | 129 }; |
129 | 130 |
130 } // namespace gpu | 131 } // namespace gpu |
131 | 132 |
132 #endif // GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ | 133 #endif // GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ |
OLD | NEW |