| 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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 613 |
| 614 int32_t PepperGraphics2DHost::OnHostMsgReadImageData( | 614 int32_t PepperGraphics2DHost::OnHostMsgReadImageData( |
| 615 ppapi::host::HostMessageContext* context, | 615 ppapi::host::HostMessageContext* context, |
| 616 PP_Resource image, | 616 PP_Resource image, |
| 617 const PP_Point& top_left) { | 617 const PP_Point& top_left) { |
| 618 context->reply_msg = PpapiPluginMsg_Graphics2D_ReadImageDataAck(); | 618 context->reply_msg = PpapiPluginMsg_Graphics2D_ReadImageDataAck(); |
| 619 return ReadImageData(image, &top_left) ? PP_OK : PP_ERROR_FAILED; | 619 return ReadImageData(image, &top_left) ? PP_OK : PP_ERROR_FAILED; |
| 620 } | 620 } |
| 621 | 621 |
| 622 void ReleaseCallback(scoped_ptr<base::SharedMemory> memory, | 622 void ReleaseCallback(scoped_ptr<base::SharedMemory> memory, |
| 623 unsigned sync_point, | 623 uint32 sync_point, |
| 624 bool lost_resource) {} | 624 bool lost_resource) {} |
| 625 | 625 |
| 626 bool PepperGraphics2DHost::PrepareTextureMailbox( | 626 bool PepperGraphics2DHost::PrepareTextureMailbox( |
| 627 cc::TextureMailbox* mailbox, | 627 cc::TextureMailbox* mailbox, |
| 628 scoped_ptr<cc::SingleReleaseCallback>* release_callback) { | 628 scoped_ptr<cc::SingleReleaseCallback>* release_callback) { |
| 629 if (!texture_mailbox_modified_) | 629 if (!texture_mailbox_modified_) |
| 630 return false; | 630 return false; |
| 631 // TODO(jbauman): Send image_data_ through mailbox to avoid copy. | 631 // TODO(jbauman): Send image_data_ through mailbox to avoid copy. |
| 632 gfx::Size pixel_image_size(image_data_->width(), image_data_->height()); | 632 gfx::Size pixel_image_size(image_data_->width(), image_data_->height()); |
| 633 int buffer_size = pixel_image_size.GetArea() * 4; | 633 int buffer_size = pixel_image_size.GetArea() * 4; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 gfx::Point inverse_scaled_point = | 881 gfx::Point inverse_scaled_point = |
| 882 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); | 882 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); |
| 883 if (original_delta != inverse_scaled_point) | 883 if (original_delta != inverse_scaled_point) |
| 884 return false; | 884 return false; |
| 885 } | 885 } |
| 886 | 886 |
| 887 return true; | 887 return true; |
| 888 } | 888 } |
| 889 | 889 |
| 890 } // namespace content | 890 } // namespace content |
| OLD | NEW |