| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 int32_t PepperGraphics2DHost::OnHostMsgReadImageData( | 542 int32_t PepperGraphics2DHost::OnHostMsgReadImageData( |
| 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 const gpu::SyncToken& sync_token, |
| 553 bool lost_resource) { | 553 bool lost_resource) { |
| 554 cached_bitmap_.reset(); | 554 cached_bitmap_.reset(); |
| 555 // Only keep around a cached bitmap if the plugin is currently drawing (has | 555 // Only keep around a cached bitmap if the plugin is currently drawing (has |
| 556 // need_flush_ack_ set). | 556 // need_flush_ack_ set). |
| 557 if (need_flush_ack_ && bound_instance_) | 557 if (need_flush_ack_ && bound_instance_) |
| 558 cached_bitmap_ = bitmap.Pass(); | 558 cached_bitmap_ = bitmap.Pass(); |
| 559 cached_bitmap_size_ = bitmap_size; | 559 cached_bitmap_size_ = bitmap_size; |
| 560 } | 560 } |
| 561 | 561 |
| 562 bool PepperGraphics2DHost::PrepareTextureMailbox( | 562 bool PepperGraphics2DHost::PrepareTextureMailbox( |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 gfx::Point inverse_scaled_point = | 814 gfx::Point inverse_scaled_point = |
| 815 gfx::ScaleToFlooredPoint(*delta, inverse_scale); | 815 gfx::ScaleToFlooredPoint(*delta, inverse_scale); |
| 816 if (original_delta != inverse_scaled_point) | 816 if (original_delta != inverse_scaled_point) |
| 817 return false; | 817 return false; |
| 818 } | 818 } |
| 819 | 819 |
| 820 return true; | 820 return true; |
| 821 } | 821 } |
| 822 | 822 |
| 823 } // namespace content | 823 } // namespace content |
| OLD | NEW |