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

Side by Side Diff: remoting/client/display/gl_cursor_feedback.cc

Issue 2614443003: Moving the GL implementation details into a sub folder for client display. (Closed)
Patch Set: Minor typo with include cought by trybot. Created 3 years, 11 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
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_cursor_feedback.h" 5 #include "remoting/client/display/gl_cursor_feedback.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <array> 9 #include <array>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "remoting/client/gl_canvas.h" 12 #include "remoting/client/display/gl_canvas.h"
13 #include "remoting/client/gl_cursor_feedback_texture.h" 13 #include "remoting/client/display/gl_cursor_feedback_texture.h"
14 #include "remoting/client/gl_math.h" 14 #include "remoting/client/display/gl_math.h"
15 #include "remoting/client/gl_render_layer.h" 15 #include "remoting/client/display/gl_render_layer.h"
16 #include "remoting/client/gl_texture_ids.h" 16 #include "remoting/client/display/gl_texture_ids.h"
17 17
18 namespace { 18 namespace {
19 19
20 const float kAnimationDurationMs = 300.f; 20 const float kAnimationDurationMs = 300.f;
21 21
22 // This function is for calculating the size of the feedback animation circle at 22 // This function is for calculating the size of the feedback animation circle at
23 // the moment when the animation progress is |progress|. 23 // the moment when the animation progress is |progress|.
24 // |progress|: [0, 1], indicating the progress of the animation. 24 // |progress|: [0, 1], indicating the progress of the animation.
25 // Returns a coefficient in [0, 1]. It will be multiplied with the maximum 25 // Returns a coefficient in [0, 1]. It will be multiplied with the maximum
26 // diameter of the feedback circle to get the current diameter of the feedback 26 // diameter of the feedback circle to get the current diameter of the feedback
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 float progress = 73 float progress =
74 (base::TimeTicks::Now() - animation_start_time_).InMilliseconds() / 74 (base::TimeTicks::Now() - animation_start_time_).InMilliseconds() /
75 kAnimationDurationMs; 75 kAnimationDurationMs;
76 if (progress > 1) { 76 if (progress > 1) {
77 animation_start_time_ = base::TimeTicks(); 77 animation_start_time_ = base::TimeTicks();
78 return false; 78 return false;
79 } 79 }
80 float diameter = GetExpansionCoefficient(progress) * max_diameter_; 80 float diameter = GetExpansionCoefficient(progress) * max_diameter_;
81 std::array<float, 8> positions; 81 std::array<float, 8> positions;
82 FillRectangleVertexPositions(cursor_x_ - diameter / 2, 82 FillRectangleVertexPositions(cursor_x_ - diameter / 2,
83 cursor_y_ - diameter / 2, 83 cursor_y_ - diameter / 2, diameter, diameter,
84 diameter, diameter, &positions); 84 &positions);
85 layer_->SetVertexPositions(positions); 85 layer_->SetVertexPositions(positions);
86 86
87 // Linear fade-out. 87 // Linear fade-out.
88 layer_->Draw(1.f - progress); 88 layer_->Draw(1.f - progress);
89 return true; 89 return true;
90 } 90 }
91 91
92 } // namespace remoting 92 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698