| 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 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // TODO(fsamuel): This should use vblank as a signal rather than a timer | 57 // TODO(fsamuel): This should use vblank as a signal rather than a timer |
| 58 // http://crbug.com/533042 | 58 // http://crbug.com/533042 |
| 59 void Draw(); | 59 void Draw(); |
| 60 | 60 |
| 61 // This is called after the DisplayCompositor has completed generating a new | 61 // This is called after the DisplayCompositor has completed generating a new |
| 62 // frame for the display. TODO(fsamuel): Idle time processing should happen | 62 // frame for the display. TODO(fsamuel): Idle time processing should happen |
| 63 // here if there is budget for it. | 63 // here if there is budget for it. |
| 64 void DidDraw(); | 64 void DidDraw(); |
| 65 | 65 |
| 66 // Generates the CompositorFrame for the current |dirty_rect_|. | 66 // Generates the CompositorFrame for the current |dirty_rect_|. |
| 67 cc::CompositorFrame GenerateCompositorFrame(); | 67 cc::CompositorFrame GenerateCompositorFrame( |
| 68 const gfx::Rect& output_rect) const; |
| 68 | 69 |
| 69 // DrawWindowTree recursively visits ServerWindows, creating a SurfaceDrawQuad | 70 // DrawWindowTree recursively visits ServerWindows, creating a SurfaceDrawQuad |
| 70 // for each that lacks one. | 71 // for each that lacks one. |
| 71 void DrawWindowTree(cc::RenderPass* pass, | 72 void DrawWindowTree(cc::RenderPass* pass, |
| 72 ServerWindow* window, | 73 ServerWindow* window, |
| 73 const gfx::Vector2d& parent_to_root_origin_offset, | 74 const gfx::Vector2d& parent_to_root_origin_offset, |
| 74 float opacity); | 75 float opacity, |
| 76 bool* may_contain_video) const; |
| 75 | 77 |
| 76 FrameGeneratorDelegate* delegate_; | 78 FrameGeneratorDelegate* delegate_; |
| 77 scoped_refptr<SurfacesState> surfaces_state_; | 79 scoped_refptr<SurfacesState> surfaces_state_; |
| 78 | 80 |
| 79 std::unique_ptr<DisplayCompositor> display_compositor_; | 81 std::unique_ptr<DisplayCompositor> display_compositor_; |
| 80 | 82 |
| 81 // The region that needs to be redrawn next time the compositor frame is | 83 // The region that needs to be redrawn next time the compositor frame is |
| 82 // generated. | 84 // generated. |
| 83 gfx::Rect dirty_rect_; | 85 gfx::Rect dirty_rect_; |
| 84 base::Timer draw_timer_; | 86 base::Timer draw_timer_; |
| 85 bool frame_pending_ = false; | 87 bool frame_pending_ = false; |
| 88 bool may_contain_video_ = false; |
| 86 | 89 |
| 87 base::WeakPtrFactory<FrameGenerator> weak_factory_; | 90 base::WeakPtrFactory<FrameGenerator> weak_factory_; |
| 88 | 91 |
| 89 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); | 92 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); |
| 90 }; | 93 }; |
| 91 | 94 |
| 92 } // namespace ws | 95 } // namespace ws |
| 93 | 96 |
| 94 } // namespace ui | 97 } // namespace ui |
| 95 | 98 |
| 96 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ | 99 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ |
| OLD | NEW |