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

Side by Side Diff: ash/laser/laser_pointer_view.cc

Issue 2812363002: ash: Fix crash in LaserPointerView::ReclaimResources. (Closed)
Patch Set: Created 3 years, 8 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 "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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 base::TimeTicks next_presentation_time = 431 base::TimeTicks next_presentation_time =
432 ui::EventTimeForNow() + presentation_delay_; 432 ui::EventTimeForNow() + presentation_delay_;
433 laser_points_.MoveForwardToTime(next_presentation_time); 433 laser_points_.MoveForwardToTime(next_presentation_time);
434 predicted_laser_points_.MoveForwardToTime(next_presentation_time); 434 predicted_laser_points_.MoveForwardToTime(next_presentation_time);
435 buffer_damage_rect_.Union(GetBoundingBox()); 435 buffer_damage_rect_.Union(GetBoundingBox());
436 OnPointsUpdated(); 436 OnPointsUpdated();
437 } 437 }
438 438
439 void LaserPointerView::DidReceiveCompositorFrameAck( 439 void LaserPointerView::DidReceiveCompositorFrameAck(
440 const cc::ReturnedResourceArray& resources) { 440 const cc::ReturnedResourceArray& resources) {
441 ReclaimResources(resources); 441 if (!resources.empty())
442 ReclaimResources(resources);
442 443
443 base::ThreadTaskRunnerHandle::Get()->PostTask( 444 base::ThreadTaskRunnerHandle::Get()->PostTask(
444 FROM_HERE, base::Bind(&LaserPointerView::OnDidDrawSurface, 445 FROM_HERE, base::Bind(&LaserPointerView::OnDidDrawSurface,
445 weak_ptr_factory_.GetWeakPtr())); 446 weak_ptr_factory_.GetWeakPtr()));
446 } 447 }
447 448
448 void LaserPointerView::ReclaimResources( 449 void LaserPointerView::ReclaimResources(
449 const cc::ReturnedResourceArray& resources) { 450 const cc::ReturnedResourceArray& resources) {
450 DCHECK_EQ(resources.size(), 1u); 451 DCHECK_EQ(resources.size(), 1u);
451 452
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 pending_draw_surface_ = true; 765 pending_draw_surface_ = true;
765 } 766 }
766 767
767 void LaserPointerView::OnDidDrawSurface() { 768 void LaserPointerView::OnDidDrawSurface() {
768 pending_draw_surface_ = false; 769 pending_draw_surface_ = false;
769 if (needs_update_surface_) 770 if (needs_update_surface_)
770 UpdateSurface(); 771 UpdateSurface();
771 } 772 }
772 773
773 } // namespace ash 774 } // namespace ash
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