OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/pepper_graphics_2d_host.h" | 5 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 | 718 |
719 // We must clear this flag before issuing the callback. It will be | 719 // We must clear this flag before issuing the callback. It will be |
720 // common for the plugin to issue another invalidate in response to a flush | 720 // common for the plugin to issue another invalidate in response to a flush |
721 // callback, and we don't want to think that a callback is already pending. | 721 // callback, and we don't want to think that a callback is already pending. |
722 offscreen_flush_pending_ = false; | 722 offscreen_flush_pending_ = false; |
723 SendFlushAck(); | 723 SendFlushAck(); |
724 } | 724 } |
725 | 725 |
726 void PepperGraphics2DHost::ScheduleOffscreenFlushAck() { | 726 void PepperGraphics2DHost::ScheduleOffscreenFlushAck() { |
727 offscreen_flush_pending_ = true; | 727 offscreen_flush_pending_ = true; |
728 MessageLoop::current()->PostDelayedTask( | 728 base::MessageLoop::current()->PostDelayedTask( |
729 FROM_HERE, | 729 FROM_HERE, |
730 base::Bind(&PepperGraphics2DHost::SendOffscreenFlushAck, | 730 base::Bind(&PepperGraphics2DHost::SendOffscreenFlushAck, |
731 weak_ptr_factory_.GetWeakPtr()), | 731 weak_ptr_factory_.GetWeakPtr()), |
732 base::TimeDelta::FromMilliseconds(kOffscreenCallbackDelayMs)); | 732 base::TimeDelta::FromMilliseconds(kOffscreenCallbackDelayMs)); |
733 } | 733 } |
734 | 734 |
735 bool PepperGraphics2DHost::HasPendingFlush() const { | 735 bool PepperGraphics2DHost::HasPendingFlush() const { |
736 return need_flush_ack_ || offscreen_flush_pending_; | 736 return need_flush_ack_ || offscreen_flush_pending_; |
737 } | 737 } |
738 | 738 |
(...skipping 21 matching lines...) Expand all Loading... |
760 gfx::Point inverse_scaled_point = | 760 gfx::Point inverse_scaled_point = |
761 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); | 761 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); |
762 if (original_delta != inverse_scaled_point) | 762 if (original_delta != inverse_scaled_point) |
763 return false; | 763 return false; |
764 } | 764 } |
765 | 765 |
766 return true; | 766 return true; |
767 } | 767 } |
768 | 768 |
769 } // namespace content | 769 } // namespace content |
OLD | NEW |