| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 void LaserPointerView::BeginFrameDidNotSwap( | 390 void LaserPointerView::BeginFrameDidNotSwap( |
| 391 const cc::BeginFrameAck& begin_frame_ack) { | 391 const cc::BeginFrameAck& begin_frame_ack) { |
| 392 frame_sink_support_.BeginFrameDidNotSwap(begin_frame_ack); | 392 frame_sink_support_.BeginFrameDidNotSwap(begin_frame_ack); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void LaserPointerView::EvictFrame() { | 395 void LaserPointerView::EvictFrame() { |
| 396 frame_sink_support_.EvictFrame(); | 396 frame_sink_support_.EvictFrame(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 void LaserPointerView::DidReceiveCompositorFrameAck() { | 399 void LaserPointerView::DidReceiveCompositorFrameAck( |
| 400 const cc::ReturnedResourceArray& resources) { |
| 401 ReclaimResources(resources); |
| 400 base::ThreadTaskRunnerHandle::Get()->PostTask( | 402 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 401 FROM_HERE, base::Bind(&LaserPointerView::OnDidDrawSurface, | 403 FROM_HERE, base::Bind(&LaserPointerView::OnDidDrawSurface, |
| 402 weak_ptr_factory_.GetWeakPtr())); | 404 weak_ptr_factory_.GetWeakPtr())); |
| 403 } | 405 } |
| 404 | 406 |
| 405 void LaserPointerView::ReclaimResources( | 407 void LaserPointerView::ReclaimResources( |
| 406 const cc::ReturnedResourceArray& resources) { | 408 const cc::ReturnedResourceArray& resources) { |
| 407 DCHECK_EQ(resources.size(), 1u); | 409 DCHECK_EQ(resources.size(), 1u); |
| 408 | 410 |
| 409 auto it = resources_.find(resources.front().id); | 411 auto it = resources_.find(resources.front().id); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 pending_draw_surface_ = true; | 722 pending_draw_surface_ = true; |
| 721 } | 723 } |
| 722 | 724 |
| 723 void LaserPointerView::OnDidDrawSurface() { | 725 void LaserPointerView::OnDidDrawSurface() { |
| 724 pending_draw_surface_ = false; | 726 pending_draw_surface_ = false; |
| 725 if (needs_update_surface_) | 727 if (needs_update_surface_) |
| 726 UpdateSurface(); | 728 UpdateSurface(); |
| 727 } | 729 } |
| 728 | 730 |
| 729 } // namespace ash | 731 } // namespace ash |
| OLD | NEW |