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/layer.h" | 13 #include "cc/layer.h" |
14 #include "cc/texture_layer.h" | 14 #include "cc/texture_layer.h" |
15 #include "content/browser/android/content_view_core_impl.h" | 15 #include "content/browser/android/content_view_core_impl.h" |
16 #include "content/browser/gpu/gpu_surface_tracker.h" | 16 #include "content/browser/gpu/gpu_surface_tracker.h" |
17 #include "content/browser/renderer_host/compositor_impl_android.h" | 17 #include "content/browser/renderer_host/compositor_impl_android.h" |
18 #include "content/browser/renderer_host/image_transport_factory_android.h" | 18 #include "content/browser/renderer_host/image_transport_factory_android.h" |
19 #include "content/browser/renderer_host/render_widget_host_impl.h" | 19 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 20 #include "content/browser/renderer_host/smooth_scroll_gesture_android.h" |
20 #include "content/browser/renderer_host/surface_texture_transport_client_android
.h" | 21 #include "content/browser/renderer_host/surface_texture_transport_client_android
.h" |
21 #include "content/common/android/device_info.h" | 22 #include "content/common/android/device_info.h" |
22 #include "content/common/gpu/client/gl_helper.h" | 23 #include "content/common/gpu/client/gl_helper.h" |
23 #include "content/common/gpu/gpu_messages.h" | 24 #include "content/common/gpu/gpu_messages.h" |
24 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
25 #include "third_party/khronos/GLES2/gl2.h" | 26 #include "third_party/khronos/GLES2/gl2.h" |
26 #include "third_party/khronos/GLES2/gl2ext.h" | 27 #include "third_party/khronos/GLES2/gl2ext.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" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 391 } |
391 | 392 |
392 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( | 393 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( |
393 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { | 394 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { |
394 if (!content_view_core_) | 395 if (!content_view_core_) |
395 return; | 396 return; |
396 | 397 |
397 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); | 398 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); |
398 } | 399 } |
399 | 400 |
| 401 SmoothScrollGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture( |
| 402 bool scroll_down, int pixels_to_scroll, int mouse_event_x, |
| 403 int mouse_event_y) { |
| 404 return new SmoothScrollGestureAndroid( |
| 405 pixels_to_scroll, |
| 406 GetRenderWidgetHost(), |
| 407 content_view_core_->CreateSmoothScroller( |
| 408 scroll_down, mouse_event_x, mouse_event_y)); |
| 409 } |
| 410 |
400 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { | 411 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { |
401 } | 412 } |
402 | 413 |
403 void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( | 414 void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( |
404 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 415 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
405 int gpu_host_id) { | 416 int gpu_host_id) { |
406 ImageTransportFactoryAndroid* factory = | 417 ImageTransportFactoryAndroid* factory = |
407 ImageTransportFactoryAndroid::GetInstance(); | 418 ImageTransportFactoryAndroid::GetInstance(); |
408 | 419 |
409 if (params.mailbox_name.empty()) | 420 if (params.mailbox_name.empty()) |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 // RenderWidgetHostView, public: | 651 // RenderWidgetHostView, public: |
641 | 652 |
642 // static | 653 // static |
643 RenderWidgetHostView* | 654 RenderWidgetHostView* |
644 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 655 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
645 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 656 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
646 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 657 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
647 } | 658 } |
648 | 659 |
649 } // namespace content | 660 } // namespace content |
OLD | NEW |