| 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 "ash/laser/laser_pointer_view.h" | 5 #include "ash/laser/laser_pointer_view.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 LaserPointerView::LaserPointerView(base::TimeDelta life_duration, | 205 LaserPointerView::LaserPointerView(base::TimeDelta life_duration, |
| 206 base::TimeDelta presentation_delay, | 206 base::TimeDelta presentation_delay, |
| 207 aura::Window* root_window) | 207 aura::Window* root_window) |
| 208 : laser_points_(life_duration), | 208 : laser_points_(life_duration), |
| 209 predicted_laser_points_(life_duration), | 209 predicted_laser_points_(life_duration), |
| 210 presentation_delay_(presentation_delay), | 210 presentation_delay_(presentation_delay), |
| 211 frame_sink_id_(aura::Env::GetInstance() | 211 frame_sink_id_(aura::Env::GetInstance() |
| 212 ->context_factory_private() | 212 ->context_factory_private() |
| 213 ->AllocateFrameSinkId()), | 213 ->AllocateFrameSinkId()), |
| 214 frame_sink_support_(this, | 214 frame_sink_support_(this, |
| 215 aura::Env::GetInstance() | |
| 216 ->context_factory_private() | |
| 217 ->GetSurfaceManager(), | |
| 218 frame_sink_id_, | 215 frame_sink_id_, |
| 219 false /* is_root */, | 216 false /* is_root */, |
| 220 true /* handles_frame_sink_id_invalidation */, | 217 true /* handles_frame_sink_id_invalidation */), |
| 221 true /* needs_sync_points */), | |
| 222 weak_ptr_factory_(this) { | 218 weak_ptr_factory_(this) { |
| 219 constexpr bool needs_sync_points = true; |
| 220 frame_sink_support_.Init( |
| 221 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(), |
| 222 needs_sync_points); |
| 223 widget_.reset(new views::Widget); | 223 widget_.reset(new views::Widget); |
| 224 views::Widget::InitParams params; | 224 views::Widget::InitParams params; |
| 225 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 225 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
| 226 params.name = "LaserOverlay"; | 226 params.name = "LaserOverlay"; |
| 227 params.accept_events = false; | 227 params.accept_events = false; |
| 228 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 228 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
| 229 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 229 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 230 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 230 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 231 params.parent = | 231 params.parent = |
| 232 Shell::GetContainer(root_window, kShellWindowId_OverlayContainer); | 232 Shell::GetContainer(root_window, kShellWindowId_OverlayContainer); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 pending_draw_surface_ = true; | 720 pending_draw_surface_ = true; |
| 721 } | 721 } |
| 722 | 722 |
| 723 void LaserPointerView::OnDidDrawSurface() { | 723 void LaserPointerView::OnDidDrawSurface() { |
| 724 pending_draw_surface_ = false; | 724 pending_draw_surface_ = false; |
| 725 if (needs_update_surface_) | 725 if (needs_update_surface_) |
| 726 UpdateSurface(); | 726 UpdateSurface(); |
| 727 } | 727 } |
| 728 | 728 |
| 729 } // namespace ash | 729 } // namespace ash |
| OLD | NEW |