| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 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 |
| 136 // Layers will be drawn from bottom to top. |
| 135 desktop_.Draw(); | 137 desktop_.Draw(); |
| 136 cursor_.Draw(); | 138 |
| 139 // |cursor_feedback_| should be drawn before |cursor_| so that the cursor |
| 140 // won't be covered by the feedback animation. |
| 137 if (cursor_feedback_.Draw()) { | 141 if (cursor_feedback_.Draw()) { |
| 138 RequestRender(); | 142 RequestRender(); |
| 139 } | 143 } |
| 144 |
| 145 cursor_.Draw(); |
| 140 } | 146 } |
| 141 | 147 |
| 142 delegate_->OnFrameRendered(); | 148 delegate_->OnFrameRendered(); |
| 143 | 149 |
| 144 while (!pending_done_callbacks_.empty()) { | 150 while (!pending_done_callbacks_.empty()) { |
| 145 pending_done_callbacks_.front().Run(); | 151 pending_done_callbacks_.front().Run(); |
| 146 pending_done_callbacks_.pop(); | 152 pending_done_callbacks_.pop(); |
| 147 } | 153 } |
| 148 } | 154 } |
| 149 | 155 |
| 150 } // namespace remoting | 156 } // namespace remoting |
| OLD | NEW |