Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: remoting/client/gl_renderer.cc

Issue 2322623003: [Remoting Android] Fix OnPixelTransformationChanged Flakiness (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 void GlRenderer::RequestCanvasSize() { 32 void GlRenderer::RequestCanvasSize() {
33 DCHECK(thread_checker_.CalledOnValidThread()); 33 DCHECK(thread_checker_.CalledOnValidThread());
34 if (delegate_) { 34 if (delegate_) {
35 delegate_->OnSizeChanged(canvas_width_, canvas_height_); 35 delegate_->OnSizeChanged(canvas_width_, canvas_height_);
36 } 36 }
37 } 37 }
38 38
39 void GlRenderer::OnPixelTransformationChanged( 39 void GlRenderer::OnPixelTransformationChanged(
40 const std::array<float, 9>& matrix) { 40 const std::array<float, 9>& matrix) {
41 DCHECK(thread_checker_.CalledOnValidThread()); 41 DCHECK(thread_checker_.CalledOnValidThread());
42 if (!canvas_) {
43 LOG(WARNING) << "Trying to set transformation matrix when the canvas is "
44 << "not ready.";
Sergey Ulanov 2016/09/08 23:21:04 nit: remove <<
Yuwei 2016/09/08 23:31:51 Done.
45 return;
46 }
42 canvas_->SetTransformationMatrix(matrix); 47 canvas_->SetTransformationMatrix(matrix);
43 RequestRender(); 48 RequestRender();
44 } 49 }
45 50
46 void GlRenderer::OnCursorMoved(float x, float y) { 51 void GlRenderer::OnCursorMoved(float x, float y) {
47 DCHECK(thread_checker_.CalledOnValidThread()); 52 DCHECK(thread_checker_.CalledOnValidThread());
48 cursor_.SetCursorPosition(x, y); 53 cursor_.SetCursorPosition(x, y);
49 RequestRender(); 54 RequestRender();
50 } 55 }
51 56
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Set the background clear color to black. 95 // Set the background clear color to black.
91 glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 96 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
92 canvas_.reset(new GlCanvas(gl_version)); 97 canvas_.reset(new GlCanvas(gl_version));
93 desktop_.SetCanvas(canvas_.get()); 98 desktop_.SetCanvas(canvas_.get());
94 cursor_.SetCanvas(canvas_.get()); 99 cursor_.SetCanvas(canvas_.get());
95 cursor_feedback_.SetCanvas(canvas_.get()); 100 cursor_feedback_.SetCanvas(canvas_.get());
96 } 101 }
97 102
98 void GlRenderer::OnSurfaceChanged(int view_width, int view_height) { 103 void GlRenderer::OnSurfaceChanged(int view_width, int view_height) {
99 DCHECK(thread_checker_.CalledOnValidThread()); 104 DCHECK(thread_checker_.CalledOnValidThread());
105 if (!canvas_) {
106 LOG(WARNING) << "Trying to set the view size when the canvas is not ready.";
107 return;
108 }
100 canvas_->SetViewSize(view_width, view_height); 109 canvas_->SetViewSize(view_width, view_height);
101 RequestRender(); 110 RequestRender();
102 } 111 }
103 112
104 void GlRenderer::OnSurfaceDestroyed() { 113 void GlRenderer::OnSurfaceDestroyed() {
105 DCHECK(thread_checker_.CalledOnValidThread()); 114 DCHECK(thread_checker_.CalledOnValidThread());
106 cursor_feedback_.SetCanvas(nullptr); 115 cursor_feedback_.SetCanvas(nullptr);
107 cursor_.SetCanvas(nullptr); 116 cursor_.SetCanvas(nullptr);
108 desktop_.SetCanvas(nullptr); 117 desktop_.SetCanvas(nullptr);
109 canvas_.reset(); 118 canvas_.reset();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 156
148 delegate_->OnFrameRendered(); 157 delegate_->OnFrameRendered();
149 158
150 while (!pending_done_callbacks_.empty()) { 159 while (!pending_done_callbacks_.empty()) {
151 pending_done_callbacks_.front().Run(); 160 pending_done_callbacks_.front().Run();
152 pending_done_callbacks_.pop(); 161 pending_done_callbacks_.pop();
153 } 162 }
154 } 163 }
155 164
156 } // namespace remoting 165 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698