OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_CLIENT_OPENGL_GL_DESKTOP_H_ |
| 6 #define REMOTING_CLIENT_OPENGL_GL_DESKTOP_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 namespace webrtc { |
| 13 class DesktopFrame; |
| 14 class DesktopRegion; |
| 15 } // namespace webrtc |
| 16 |
| 17 namespace remoting { |
| 18 |
| 19 class GlCanvas; |
| 20 class GlRenderLayer; |
| 21 |
| 22 // This class draws the desktop on the canvas. |
| 23 class GlDesktop { |
| 24 public: |
| 25 GlDesktop(); |
| 26 virtual ~GlDesktop(); |
| 27 |
| 28 void SetVideoFrame(std::unique_ptr<webrtc::DesktopFrame> frame); |
| 29 |
| 30 // Sets the canvas on which the desktop will be drawn. Resumes the current |
| 31 // state of the desktop to the context of the new canvas. |
| 32 // If |canvas| is nullptr, nothing will happen when calling Draw(). |
| 33 void SetCanvas(GlCanvas* canvas); |
| 34 |
| 35 // Draws the desktop on the canvas. |
| 36 void Draw(); |
| 37 |
| 38 private: |
| 39 std::unique_ptr<GlRenderLayer> layer_; |
| 40 std::unique_ptr<webrtc::DesktopFrame> last_frame_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(GlDesktop); |
| 43 }; |
| 44 |
| 45 } // namespace remoting |
| 46 |
| 47 #endif // REMOTING_CLIENT_OPENGL_GL_DESKTOP_H_ |
OLD | NEW |