| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_WS_FRAME_GENERATOR_H_ | 5 #ifndef SERVICES_UI_WS_FRAME_GENERATOR_H_ |
| 6 #define SERVICES_UI_WS_FRAME_GENERATOR_H_ | 6 #define SERVICES_UI_WS_FRAME_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // cc::mojom::MojoCompositorFrameSinkClient implementation: | 70 // cc::mojom::MojoCompositorFrameSinkClient implementation: |
| 71 void DidReceiveCompositorFrameAck() override; | 71 void DidReceiveCompositorFrameAck() override; |
| 72 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_arags) override; | 72 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_arags) override; |
| 73 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 73 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| 74 void WillDrawSurface() override; | 74 void WillDrawSurface() override; |
| 75 | 75 |
| 76 // Generates the CompositorFrame. | 76 // Generates the CompositorFrame. |
| 77 cc::CompositorFrame GenerateCompositorFrame(const gfx::Rect& output_rect); | 77 cc::CompositorFrame GenerateCompositorFrame(const gfx::Rect& output_rect); |
| 78 | 78 |
| 79 // DrawWindowTree recursively visits ServerWindows, creating a SurfaceDrawQuad | 79 // DrawWindow creates SurfaceDrawQuad for the provided ServerWindow and |
| 80 // for each that lacks one. | 80 // appends it to the provided cc::RenderPass. |
| 81 void DrawWindowTree(cc::RenderPass* pass, | 81 void DrawWindow(cc::RenderPass* pass, ServerWindow* window); |
| 82 ServerWindow* window, | |
| 83 const gfx::Vector2d& parent_to_root_origin_offset, | |
| 84 float opacity); | |
| 85 | 82 |
| 86 // Finds the parent surface id for |window|. | 83 // Finds the parent surface id for |window|. |
| 87 cc::SurfaceId FindParentSurfaceId(ServerWindow* window); | 84 cc::SurfaceId FindParentSurfaceId(ServerWindow* window); |
| 88 | 85 |
| 89 // Adds surface reference to local cache and surface manager. | 86 // Adds surface reference to local cache and surface manager. |
| 90 void AddSurfaceReference(const cc::SurfaceId& parent_id, | 87 void AddSurfaceReference(const cc::SurfaceId& parent_id, |
| 91 const cc::SurfaceId& child_id); | 88 const cc::SurfaceId& child_id); |
| 92 | 89 |
| 93 // Does work necessary for adding the first surface reference. | 90 // Does work necessary for adding the first surface reference. |
| 94 void AddFirstReference(const cc::SurfaceId& surface_id, ServerWindow* window); | 91 void AddFirstReference(const cc::SurfaceId& surface_id, ServerWindow* window); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 base::WeakPtrFactory<FrameGenerator> weak_factory_; | 145 base::WeakPtrFactory<FrameGenerator> weak_factory_; |
| 149 | 146 |
| 150 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); | 147 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); |
| 151 }; | 148 }; |
| 152 | 149 |
| 153 } // namespace ws | 150 } // namespace ws |
| 154 | 151 |
| 155 } // namespace ui | 152 } // namespace ui |
| 156 | 153 |
| 157 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ | 154 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ |
| OLD | NEW |