| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // This is a placeholder surface used when not rendering to the | 89 // This is a placeholder surface used when not rendering to the |
| 90 // DirectComposition surface. | 90 // DirectComposition surface. |
| 91 EGLSurface default_surface_ = 0; | 91 EGLSurface default_surface_ = 0; |
| 92 | 92 |
| 93 // This is the real surface representing the backbuffer. It may be null | 93 // This is the real surface representing the backbuffer. It may be null |
| 94 // outside of a BeginDraw/EndDraw pair. | 94 // outside of a BeginDraw/EndDraw pair. |
| 95 EGLSurface real_surface_ = 0; | 95 EGLSurface real_surface_ = 0; |
| 96 gfx::Size size_ = gfx::Size(1, 1); | 96 gfx::Size size_ = gfx::Size(1, 1); |
| 97 bool first_swap_ = true; | 97 bool first_swap_ = true; |
| 98 bool enable_dc_layers_ = false; | 98 bool enable_dc_layers_ = false; |
| 99 bool has_alpha_ = true; |
| 99 std::unique_ptr<gfx::VSyncProvider> vsync_provider_; | 100 std::unique_ptr<gfx::VSyncProvider> vsync_provider_; |
| 100 gfx::Rect swap_rect_; | 101 gfx::Rect swap_rect_; |
| 101 std::unique_ptr<DCLayerTree> layer_tree_; | 102 std::unique_ptr<DCLayerTree> layer_tree_; |
| 102 gfx::Vector2d draw_offset_; | 103 gfx::Vector2d draw_offset_; |
| 103 | 104 |
| 104 base::win::ScopedComPtr<ID3D11Device> d3d11_device_; | 105 base::win::ScopedComPtr<ID3D11Device> d3d11_device_; |
| 105 base::win::ScopedComPtr<IDCompositionDevice2> dcomp_device_; | 106 base::win::ScopedComPtr<IDCompositionDevice2> dcomp_device_; |
| 106 base::win::ScopedComPtr<IDCompositionSurface> dcomp_surface_; | 107 base::win::ScopedComPtr<IDCompositionSurface> dcomp_surface_; |
| 107 base::win::ScopedComPtr<IDXGISwapChain1> swap_chain_; | 108 base::win::ScopedComPtr<IDXGISwapChain1> swap_chain_; |
| 108 base::win::ScopedComPtr<ID3D11Texture2D> draw_texture_; | 109 base::win::ScopedComPtr<ID3D11Texture2D> draw_texture_; |
| 109 | 110 |
| 110 // Keep track of whether the texture has been rendered to, as the first draw | 111 // Keep track of whether the texture has been rendered to, as the first draw |
| 111 // to it must overwrite the entire thing. | 112 // to it must overwrite the entire thing. |
| 112 bool has_been_rendered_to_ = false; | 113 bool has_been_rendered_to_ = false; |
| 113 | 114 |
| 114 DISALLOW_COPY_AND_ASSIGN(DirectCompositionSurfaceWin); | 115 DISALLOW_COPY_AND_ASSIGN(DirectCompositionSurfaceWin); |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 } // namespace gpu | 118 } // namespace gpu |
| 118 | 119 |
| 119 #endif // GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ | 120 #endif // GPU_IPC_SERVICE_DIRECT_COMPOSITION_SURFACE_WIN_H_ |
| OLD | NEW |