| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 396 |
| 397 float PepperGraphics2DHost::GetScale() const { return scale_; } | 397 float PepperGraphics2DHost::GetScale() const { return scale_; } |
| 398 | 398 |
| 399 bool PepperGraphics2DHost::IsAlwaysOpaque() const { return is_always_opaque_; } | 399 bool PepperGraphics2DHost::IsAlwaysOpaque() const { return is_always_opaque_; } |
| 400 | 400 |
| 401 PPB_ImageData_Impl* PepperGraphics2DHost::ImageData() { | 401 PPB_ImageData_Impl* PepperGraphics2DHost::ImageData() { |
| 402 return image_data_.get(); | 402 return image_data_.get(); |
| 403 } | 403 } |
| 404 | 404 |
| 405 gfx::Size PepperGraphics2DHost::Size() const { | 405 gfx::Size PepperGraphics2DHost::Size() const { |
| 406 if (!image_data_) | 406 if (!image_data_.get()) |
| 407 return gfx::Size(); | 407 return gfx::Size(); |
| 408 return gfx::Size(image_data_->width(), image_data_->height()); | 408 return gfx::Size(image_data_->width(), image_data_->height()); |
| 409 } | 409 } |
| 410 | 410 |
| 411 int32_t PepperGraphics2DHost::OnHostMsgPaintImageData( | 411 int32_t PepperGraphics2DHost::OnHostMsgPaintImageData( |
| 412 ppapi::host::HostMessageContext* context, | 412 ppapi::host::HostMessageContext* context, |
| 413 const ppapi::HostResource& image_data, | 413 const ppapi::HostResource& image_data, |
| 414 const PP_Point& top_left, | 414 const PP_Point& top_left, |
| 415 bool src_rect_specified, | 415 bool src_rect_specified, |
| 416 const PP_Rect& src_rect) { | 416 const PP_Rect& src_rect) { |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 gfx::Point inverse_scaled_point = | 790 gfx::Point inverse_scaled_point = |
| 791 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); | 791 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); |
| 792 if (original_delta != inverse_scaled_point) | 792 if (original_delta != inverse_scaled_point) |
| 793 return false; | 793 return false; |
| 794 } | 794 } |
| 795 | 795 |
| 796 return true; | 796 return true; |
| 797 } | 797 } |
| 798 | 798 |
| 799 } // namespace content | 799 } // namespace content |
| OLD | NEW |