Chromium Code Reviews| 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 #include "remoting/client/gl_renderer.h" | 5 #include "remoting/client/gl_renderer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "remoting/client/gl_canvas.h" | 10 #include "remoting/client/gl_canvas.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 void GlRenderer::OnRender() { | 126 void GlRenderer::OnRender() { |
| 127 DCHECK(thread_checker_.CalledOnValidThread()); | 127 DCHECK(thread_checker_.CalledOnValidThread()); |
| 128 render_scheduled_ = false; | 128 render_scheduled_ = false; |
| 129 if (!delegate_ || !delegate_->CanRenderFrame()) { | 129 if (!delegate_ || !delegate_->CanRenderFrame()) { |
| 130 return; | 130 return; |
| 131 } | 131 } |
| 132 | 132 |
| 133 if (canvas_) { | 133 if (canvas_) { |
| 134 glClear(GL_COLOR_BUFFER_BIT); | 134 glClear(GL_COLOR_BUFFER_BIT); |
| 135 desktop_.Draw(); | 135 desktop_.Draw(); |
| 136 cursor_.Draw(); | |
| 137 if (cursor_feedback_.Draw()) { | 136 if (cursor_feedback_.Draw()) { |
| 138 RequestRender(); | 137 RequestRender(); |
| 139 } | 138 } |
| 139 cursor_.Draw(); | |
|
joedow
2016/08/24 18:53:28
I think it would be good to add some comments (eit
Yuwei
2016/08/24 19:06:44
Done.
| |
| 140 } | 140 } |
| 141 | 141 |
| 142 delegate_->OnFrameRendered(); | 142 delegate_->OnFrameRendered(); |
| 143 | 143 |
| 144 while (!pending_done_callbacks_.empty()) { | 144 while (!pending_done_callbacks_.empty()) { |
| 145 pending_done_callbacks_.front().Run(); | 145 pending_done_callbacks_.front().Run(); |
| 146 pending_done_callbacks_.pop(); | 146 pending_done_callbacks_.pop(); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace remoting | 150 } // namespace remoting |
| OLD | NEW |