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/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 ppapi::host::HostMessageContext* context, | 543 ppapi::host::HostMessageContext* context, |
544 PP_Resource image, | 544 PP_Resource image, |
545 const PP_Point& top_left) { | 545 const PP_Point& top_left) { |
546 context->reply_msg = PpapiPluginMsg_Graphics2D_ReadImageDataAck(); | 546 context->reply_msg = PpapiPluginMsg_Graphics2D_ReadImageDataAck(); |
547 return ReadImageData(image, &top_left) ? PP_OK : PP_ERROR_FAILED; | 547 return ReadImageData(image, &top_left) ? PP_OK : PP_ERROR_FAILED; |
548 } | 548 } |
549 | 549 |
550 void PepperGraphics2DHost::ReleaseCallback(scoped_ptr<cc::SharedBitmap> bitmap, | 550 void PepperGraphics2DHost::ReleaseCallback(scoped_ptr<cc::SharedBitmap> bitmap, |
551 const gfx::Size& bitmap_size, | 551 const gfx::Size& bitmap_size, |
552 uint32 sync_point, | 552 uint32 sync_point, |
| 553 const gpu::SyncToken& sync_token, |
553 bool lost_resource) { | 554 bool lost_resource) { |
554 cached_bitmap_.reset(); | 555 cached_bitmap_.reset(); |
555 // Only keep around a cached bitmap if the plugin is currently drawing (has | 556 // Only keep around a cached bitmap if the plugin is currently drawing (has |
556 // need_flush_ack_ set). | 557 // need_flush_ack_ set). |
557 if (need_flush_ack_ && bound_instance_) | 558 if (need_flush_ack_ && bound_instance_) |
558 cached_bitmap_ = bitmap.Pass(); | 559 cached_bitmap_ = bitmap.Pass(); |
559 cached_bitmap_size_ = bitmap_size; | 560 cached_bitmap_size_ = bitmap_size; |
560 } | 561 } |
561 | 562 |
562 bool PepperGraphics2DHost::PrepareTextureMailbox( | 563 bool PepperGraphics2DHost::PrepareTextureMailbox( |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 gfx::Point inverse_scaled_point = | 815 gfx::Point inverse_scaled_point = |
815 gfx::ScaleToFlooredPoint(*delta, inverse_scale); | 816 gfx::ScaleToFlooredPoint(*delta, inverse_scale); |
816 if (original_delta != inverse_scaled_point) | 817 if (original_delta != inverse_scaled_point) |
817 return false; | 818 return false; |
818 } | 819 } |
819 | 820 |
820 return true; | 821 return true; |
821 } | 822 } |
822 | 823 |
823 } // namespace content | 824 } // namespace content |
OLD | NEW |