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

Unified Diff: ash/laser/laser_pointer_view.h

Issue 2745953002: ash: Add basic prediction code to the laser pointer. (Closed)
Patch Set: more tests and nits Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/laser/laser_pointer_points_unittest.cc ('k') | ash/laser/laser_pointer_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/laser/laser_pointer_view.h
diff --git a/ash/laser/laser_pointer_view.h b/ash/laser/laser_pointer_view.h
index c5cdb32840d3d8062e03707e8c1bdb797fce8b33..201878e879db735a4df00ef80be20d0bfb5263bc 100644
--- a/ash/laser/laser_pointer_view.h
+++ b/ash/laser/laser_pointer_view.h
@@ -12,6 +12,7 @@
#include "ash/laser/laser_pointer_points.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
#include "cc/ipc/compositor_frame.mojom.h"
#include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
#include "cc/resources/texture_mailbox.h"
@@ -44,10 +45,13 @@ class LaserPointerView : public views::View,
public cc::mojom::MojoCompositorFrameSink,
public cc::CompositorFrameSinkSupportClient {
public:
- LaserPointerView(base::TimeDelta life_duration, aura::Window* root_window);
+ LaserPointerView(base::TimeDelta life_duration,
+ base::TimeDelta presentation_delay,
+ aura::Window* root_window);
~LaserPointerView() override;
- void AddNewPoint(const gfx::PointF& new_point);
+ void AddNewPoint(const gfx::PointF& new_point,
+ const base::TimeTicks& new_time);
void UpdateTime();
void Stop();
@@ -75,8 +79,10 @@ class LaserPointerView : public views::View,
void OnDidDrawSurface();
LaserPointerPoints laser_points_;
+ LaserPointerPoints predicted_laser_points_;
std::unique_ptr<views::Widget> widget_;
float scale_factor_ = 1.0f;
+ const base::TimeDelta presentation_delay_;
std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer_;
gfx::Rect buffer_damage_rect_;
bool pending_update_buffer_ = false;
« no previous file with comments | « ash/laser/laser_pointer_points_unittest.cc ('k') | ash/laser/laser_pointer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698