| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 377 } |
| 377 | 378 |
| 378 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( | 379 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( |
| 379 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { | 380 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { |
| 380 if (!content_view_core_) | 381 if (!content_view_core_) |
| 381 return; | 382 return; |
| 382 | 383 |
| 383 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); | 384 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); |
| 384 } | 385 } |
| 385 | 386 |
| 387 SmoothScrollGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture( |
| 388 bool scroll_down, int pixels_to_scroll, int mouse_event_x, |
| 389 int mouse_event_y) { |
| 390 return new SmoothScrollGestureAndroid( |
| 391 pixels_to_scroll, |
| 392 GetRenderWidgetHost(), |
| 393 content_view_core_->CreateSmoothScroller( |
| 394 scroll_down, mouse_event_x, mouse_event_y)); |
| 395 } |
| 396 |
| 386 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { | 397 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { |
| 387 } | 398 } |
| 388 | 399 |
| 389 void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( | 400 void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( |
| 390 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 401 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
| 391 int gpu_host_id) { | 402 int gpu_host_id) { |
| 392 ImageTransportFactoryAndroid* factory = | 403 ImageTransportFactoryAndroid* factory = |
| 393 ImageTransportFactoryAndroid::GetInstance(); | 404 ImageTransportFactoryAndroid::GetInstance(); |
| 394 | 405 |
| 395 // TODO(sievers): When running the impl thread in the browser we | 406 // TODO(sievers): When running the impl thread in the browser we |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // RenderWidgetHostView, public: | 641 // RenderWidgetHostView, public: |
| 631 | 642 |
| 632 // static | 643 // static |
| 633 RenderWidgetHostView* | 644 RenderWidgetHostView* |
| 634 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 645 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 635 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 646 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 636 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 647 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 637 } | 648 } |
| 638 | 649 |
| 639 } // namespace content | 650 } // namespace content |
| OLD | NEW |