Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 11793003: Relands: Telemetry: hooks "chrome.gpuBenchmarking.smoothScrollBy" with java on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 } 512 }
512 513
513 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( 514 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup(
514 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { 515 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) {
515 if (!content_view_core_) 516 if (!content_view_core_)
516 return; 517 return;
517 518
518 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); 519 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap);
519 } 520 }
520 521
522 SmoothScrollGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture(
523 bool scroll_down, int pixels_to_scroll, int mouse_event_x,
524 int mouse_event_y) {
525 return new TouchSmoothScrollGestureAndroid(
526 pixels_to_scroll,
527 GetRenderWidgetHost(),
528 content_view_core_->CreateSmoothScroller(
529 scroll_down, mouse_event_x, mouse_event_y));
530 }
531
521 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { 532 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() {
522 } 533 }
523 534
524 void RenderWidgetHostViewAndroid::OnSwapCompositorFrame( 535 void RenderWidgetHostViewAndroid::OnSwapCompositorFrame(
525 scoped_ptr<cc::CompositorFrame> frame) { 536 scoped_ptr<cc::CompositorFrame> frame) {
526 // Always let ContentViewCore know about the new frame first, so it can decide 537 // Always let ContentViewCore know about the new frame first, so it can decide
527 // to schedule a Draw immediately when it sees the texture layer invalidation. 538 // to schedule a Draw immediately when it sees the texture layer invalidation.
528 if (content_view_core_) { 539 if (content_view_core_) {
529 // All offsets and sizes are in CSS pixels. 540 // All offsets and sizes are in CSS pixels.
530 content_view_core_->UpdateFrameInfo( 541 content_view_core_->UpdateFrameInfo(
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 // RenderWidgetHostView, public: 886 // RenderWidgetHostView, public:
876 887
877 // static 888 // static
878 RenderWidgetHostView* 889 RenderWidgetHostView*
879 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 890 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
880 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 891 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
881 return new RenderWidgetHostViewAndroid(rwhi, NULL); 892 return new RenderWidgetHostViewAndroid(rwhi, NULL);
882 } 893 }
883 894
884 } // namespace content 895 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698