| 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/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 DCHECK(content_view_core_); | 1153 DCHECK(content_view_core_); |
| 1154 content_view_core_->OnSelectionEvent(event, position); | 1154 content_view_core_->OnSelectionEvent(event, position); |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 scoped_ptr<TouchHandleDrawable> RenderWidgetHostViewAndroid::CreateDrawable() { | 1157 scoped_ptr<TouchHandleDrawable> RenderWidgetHostViewAndroid::CreateDrawable() { |
| 1158 DCHECK(content_view_core_); | 1158 DCHECK(content_view_core_); |
| 1159 if (using_synchronous_compositor_) | 1159 if (using_synchronous_compositor_) |
| 1160 return content_view_core_->CreatePopupTouchHandleDrawable(); | 1160 return content_view_core_->CreatePopupTouchHandleDrawable(); |
| 1161 | 1161 |
| 1162 return scoped_ptr<TouchHandleDrawable>(new CompositedTouchHandleDrawable( | 1162 return scoped_ptr<TouchHandleDrawable>(new CompositedTouchHandleDrawable( |
| 1163 content_view_core_->GetLayer(), | 1163 content_view_core_->GetLayer().get(), |
| 1164 content_view_core_->GetDpiScale(), | 1164 content_view_core_->GetDpiScale(), |
| 1165 base::android::GetApplicationContext())); | 1165 base::android::GetApplicationContext())); |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 void RenderWidgetHostViewAndroid::SynchronousCopyContents( | 1168 void RenderWidgetHostViewAndroid::SynchronousCopyContents( |
| 1169 const gfx::Rect& src_subrect_in_pixel, | 1169 const gfx::Rect& src_subrect_in_pixel, |
| 1170 const gfx::Size& dst_size_in_pixel, | 1170 const gfx::Size& dst_size_in_pixel, |
| 1171 const base::Callback<void(bool, const SkBitmap&)>& callback, | 1171 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 1172 const SkColorType color_type) { | 1172 const SkColorType color_type) { |
| 1173 SynchronousCompositor* compositor = | 1173 SynchronousCompositor* compositor = |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 | 1511 |
| 1512 void RenderWidgetHostViewAndroid::DidOverscroll( | 1512 void RenderWidgetHostViewAndroid::DidOverscroll( |
| 1513 const DidOverscrollParams& params) { | 1513 const DidOverscrollParams& params) { |
| 1514 if (!content_view_core_ || !layer_.get() || !is_showing_) | 1514 if (!content_view_core_ || !layer_.get() || !is_showing_) |
| 1515 return; | 1515 return; |
| 1516 | 1516 |
| 1517 const float device_scale_factor = content_view_core_->GetDpiScale(); | 1517 const float device_scale_factor = content_view_core_->GetDpiScale(); |
| 1518 | 1518 |
| 1519 if (overscroll_effect_ && | 1519 if (overscroll_effect_ && |
| 1520 overscroll_effect_->OnOverscrolled( | 1520 overscroll_effect_->OnOverscrolled( |
| 1521 content_view_core_->GetLayer(), | 1521 content_view_core_->GetLayer().get(), |
| 1522 base::TimeTicks::Now(), | 1522 base::TimeTicks::Now(), |
| 1523 gfx::ScaleVector2d(params.accumulated_overscroll, | 1523 gfx::ScaleVector2d(params.accumulated_overscroll, |
| 1524 device_scale_factor), | 1524 device_scale_factor), |
| 1525 gfx::ScaleVector2d(params.latest_overscroll_delta, | 1525 gfx::ScaleVector2d(params.latest_overscroll_delta, |
| 1526 device_scale_factor), | 1526 device_scale_factor), |
| 1527 gfx::ScaleVector2d(params.current_fling_velocity, | 1527 gfx::ScaleVector2d(params.current_fling_velocity, |
| 1528 device_scale_factor), | 1528 device_scale_factor), |
| 1529 gfx::ScaleVector2d( | 1529 gfx::ScaleVector2d( |
| 1530 params.causal_event_viewport_point.OffsetFromOrigin(), | 1530 params.causal_event_viewport_point.OffsetFromOrigin(), |
| 1531 device_scale_factor))) { | 1531 device_scale_factor))) { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 results->orientationAngle = display.RotationAsDegree(); | 1772 results->orientationAngle = display.RotationAsDegree(); |
| 1773 results->orientationType = | 1773 results->orientationType = |
| 1774 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1774 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1775 gfx::DeviceDisplayInfo info; | 1775 gfx::DeviceDisplayInfo info; |
| 1776 results->depth = info.GetBitsPerPixel(); | 1776 results->depth = info.GetBitsPerPixel(); |
| 1777 results->depthPerComponent = info.GetBitsPerComponent(); | 1777 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1778 results->isMonochrome = (results->depthPerComponent == 0); | 1778 results->isMonochrome = (results->depthPerComponent == 0); |
| 1779 } | 1779 } |
| 1780 | 1780 |
| 1781 } // namespace content | 1781 } // namespace content |
| OLD | NEW |