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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
14 #include "cc/layers/texture_layer.h" | 14 #include "cc/layers/texture_layer.h" |
15 #include "cc/output/compositor_frame.h" | 15 #include "cc/output/compositor_frame.h" |
16 #include "cc/output/compositor_frame_ack.h" | 16 #include "cc/output/compositor_frame_ack.h" |
17 #include "content/browser/android/content_view_core_impl.h" | 17 #include "content/browser/android/content_view_core_impl.h" |
18 #include "content/browser/gpu/gpu_surface_tracker.h" | 18 #include "content/browser/gpu/gpu_surface_tracker.h" |
19 #include "content/browser/renderer_host/compositor_impl_android.h" | 19 #include "content/browser/renderer_host/compositor_impl_android.h" |
20 #include "content/browser/renderer_host/image_transport_factory_android.h" | 20 #include "content/browser/renderer_host/image_transport_factory_android.h" |
21 #include "content/browser/renderer_host/render_widget_host_impl.h" | 21 #include "content/browser/renderer_host/render_widget_host_impl.h" |
22 #include "content/browser/renderer_host/surface_texture_transport_client_android
.h" | 22 #include "content/browser/renderer_host/surface_texture_transport_client_android
.h" |
| 23 #include "content/browser/renderer_host/touch_smooth_scroll_gesture_android.h" |
23 #include "content/common/gpu/client/gl_helper.h" | 24 #include "content/common/gpu/client/gl_helper.h" |
24 #include "content/common/gpu/gpu_messages.h" | 25 #include "content/common/gpu/gpu_messages.h" |
25 #include "content/common/input_messages.h" | 26 #include "content/common/input_messages.h" |
26 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
27 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" | 28 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
28 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayer.h" | 29 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayer.h" |
29 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 30 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
30 #include "third_party/khronos/GLES2/gl2.h" | 31 #include "third_party/khronos/GLES2/gl2.h" |
31 #include "third_party/khronos/GLES2/gl2ext.h" | 32 #include "third_party/khronos/GLES2/gl2ext.h" |
32 #include "ui/gfx/android/device_display_info.h" | 33 #include "ui/gfx/android/device_display_info.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 } | 511 } |
511 | 512 |
512 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( | 513 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( |
513 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { | 514 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { |
514 if (!content_view_core_) | 515 if (!content_view_core_) |
515 return; | 516 return; |
516 | 517 |
517 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); | 518 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); |
518 } | 519 } |
519 | 520 |
| 521 SmoothScrollGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture( |
| 522 bool scroll_down, int pixels_to_scroll, int mouse_event_x, |
| 523 int mouse_event_y) { |
| 524 return new TouchSmoothScrollGestureAndroid( |
| 525 pixels_to_scroll, |
| 526 GetRenderWidgetHost(), |
| 527 content_view_core_->CreateSmoothScroller( |
| 528 scroll_down, mouse_event_x, mouse_event_y)); |
| 529 } |
| 530 |
520 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { | 531 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { |
521 } | 532 } |
522 | 533 |
523 void RenderWidgetHostViewAndroid::OnSwapCompositorFrame( | 534 void RenderWidgetHostViewAndroid::OnSwapCompositorFrame( |
524 scoped_ptr<cc::CompositorFrame> frame) { | 535 scoped_ptr<cc::CompositorFrame> frame) { |
525 // Always let ContentViewCore know about the new frame first, so it can decide | 536 // Always let ContentViewCore know about the new frame first, so it can decide |
526 // to schedule a Draw immediately when it sees the texture layer invalidation. | 537 // to schedule a Draw immediately when it sees the texture layer invalidation. |
527 if (content_view_core_) { | 538 if (content_view_core_) { |
528 // All offsets and sizes are in CSS pixels. | 539 // All offsets and sizes are in CSS pixels. |
529 content_view_core_->UpdateFrameInfo( | 540 content_view_core_->UpdateFrameInfo( |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 // RenderWidgetHostView, public: | 848 // RenderWidgetHostView, public: |
838 | 849 |
839 // static | 850 // static |
840 RenderWidgetHostView* | 851 RenderWidgetHostView* |
841 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 852 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
842 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 853 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
843 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 854 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
844 } | 855 } |
845 | 856 |
846 } // namespace content | 857 } // namespace content |
OLD | NEW |