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

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

Issue 26753005: Adding compositor callbacks to RenderWidgetHostViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 7 years, 1 month 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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/process/process.h" 16 #include "base/process/process.h"
17 #include "cc/layers/delegated_frame_resource_collection.h" 17 #include "cc/layers/delegated_frame_resource_collection.h"
18 #include "cc/layers/delegated_renderer_layer_client.h" 18 #include "cc/layers/delegated_renderer_layer_client.h"
19 #include "cc/layers/texture_layer_client.h" 19 #include "cc/layers/texture_layer_client.h"
20 #include "cc/output/begin_frame_args.h" 20 #include "cc/output/begin_frame_args.h"
21 #include "content/browser/accessibility/browser_accessibility_manager.h" 21 #include "content/browser/accessibility/browser_accessibility_manager.h"
22 #include "content/browser/renderer_host/image_transport_factory_android.h" 22 #include "content/browser/renderer_host/image_transport_factory_android.h"
23 #include "content/browser/renderer_host/ime_adapter_android.h" 23 #include "content/browser/renderer_host/ime_adapter_android.h"
24 #include "content/browser/renderer_host/render_widget_host_view_base.h" 24 #include "content/browser/renderer_host/render_widget_host_view_base.h"
25 #include "gpu/command_buffer/common/mailbox.h" 25 #include "gpu/command_buffer/common/mailbox.h"
26 #include "third_party/skia/include/core/SkColor.h" 26 #include "third_party/skia/include/core/SkColor.h"
27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
28 #include "ui/base/android/window_android_observer.h"
28 #include "ui/gfx/size.h" 29 #include "ui/gfx/size.h"
29 #include "ui/gfx/vector2d_f.h" 30 #include "ui/gfx/vector2d_f.h"
30 31
31 struct ViewHostMsg_TextInputState_Params; 32 struct ViewHostMsg_TextInputState_Params;
32 33
33 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; 34 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
34 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; 35 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params;
35 36
36 namespace cc { 37 namespace cc {
37 class CopyOutputResult; 38 class CopyOutputResult;
(...skipping 16 matching lines...) Expand all
54 class RenderWidgetHost; 55 class RenderWidgetHost;
55 class RenderWidgetHostImpl; 56 class RenderWidgetHostImpl;
56 struct NativeWebKeyboardEvent; 57 struct NativeWebKeyboardEvent;
57 58
58 // ----------------------------------------------------------------------------- 59 // -----------------------------------------------------------------------------
59 // See comments in render_widget_host_view.h about this class and its members. 60 // See comments in render_widget_host_view.h about this class and its members.
60 // ----------------------------------------------------------------------------- 61 // -----------------------------------------------------------------------------
61 class RenderWidgetHostViewAndroid 62 class RenderWidgetHostViewAndroid
62 : public RenderWidgetHostViewBase, 63 : public RenderWidgetHostViewBase,
63 public BrowserAccessibilityDelegate, 64 public BrowserAccessibilityDelegate,
64 public cc::TextureLayerClient,
65 public cc::DelegatedRendererLayerClient,
66 public cc::DelegatedFrameResourceCollectionClient, 65 public cc::DelegatedFrameResourceCollectionClient,
67 public ImageTransportFactoryAndroidObserver { 66 public ImageTransportFactoryAndroidObserver,
67 public ui::WindowAndroidObserver {
68 public: 68 public:
69 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, 69 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget,
70 ContentViewCoreImpl* content_view_core); 70 ContentViewCoreImpl* content_view_core);
71 virtual ~RenderWidgetHostViewAndroid(); 71 virtual ~RenderWidgetHostViewAndroid();
72 72
73 // RenderWidgetHostView implementation. 73 // RenderWidgetHostView implementation.
74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
75 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; 75 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
76 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 76 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
77 const gfx::Rect& pos) OVERRIDE; 77 const gfx::Rect& pos) OVERRIDE;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; 185 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE;
186 virtual void AccessibilityScrollToMakeVisible( 186 virtual void AccessibilityScrollToMakeVisible(
187 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; 187 int acc_obj_id, gfx::Rect subfocus) OVERRIDE;
188 virtual void AccessibilityScrollToPoint( 188 virtual void AccessibilityScrollToPoint(
189 int acc_obj_id, gfx::Point point) OVERRIDE; 189 int acc_obj_id, gfx::Point point) OVERRIDE;
190 virtual void AccessibilitySetTextSelection( 190 virtual void AccessibilitySetTextSelection(
191 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; 191 int acc_obj_id, int start_offset, int end_offset) OVERRIDE;
192 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; 192 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE;
193 virtual void FatalAccessibilityTreeError() OVERRIDE; 193 virtual void FatalAccessibilityTreeError() OVERRIDE;
194 194
195 // cc::TextureLayerClient implementation.
196 virtual unsigned PrepareTexture() OVERRIDE;
197 virtual bool PrepareTextureMailbox(
198 cc::TextureMailbox* mailbox,
199 scoped_ptr<cc::SingleReleaseCallback>* release_callback,
200 bool use_shared_memory) OVERRIDE;
201
202 // cc::DelegatedRendererLayerClient implementation.
203 virtual void DidCommitFrameData() OVERRIDE;
204
205 // cc::DelegatedFrameResourceCollectionClient implementation. 195 // cc::DelegatedFrameResourceCollectionClient implementation.
206 virtual void UnusedResourcesAreAvailable() OVERRIDE; 196 virtual void UnusedResourcesAreAvailable() OVERRIDE;
207 197
198 // ui::WindowAndroidObserver implementation.
199 virtual void OnCompositingDidCommit() OVERRIDE;
200 virtual void OnAttachCompositor() OVERRIDE {}
201 virtual void OnDetachCompositor() OVERRIDE;
202
208 // ImageTransportFactoryAndroidObserver implementation. 203 // ImageTransportFactoryAndroidObserver implementation.
209 virtual void OnLostResources() OVERRIDE; 204 virtual void OnLostResources() OVERRIDE;
210 205
211 // Non-virtual methods 206 // Non-virtual methods
212 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 207 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
213 SkColor GetCachedBackgroundColor() const; 208 SkColor GetCachedBackgroundColor() const;
214 void SendKeyEvent(const NativeWebKeyboardEvent& event); 209 void SendKeyEvent(const NativeWebKeyboardEvent& event);
215 void SendTouchEvent(const blink::WebTouchEvent& event); 210 void SendTouchEvent(const blink::WebTouchEvent& event);
216 void SendMouseEvent(const blink::WebMouseEvent& event); 211 void SendMouseEvent(const blink::WebMouseEvent& event);
217 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); 212 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 void ResetClipping(); 260 void ResetClipping();
266 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); 261 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size);
267 262
268 void AttachLayers(); 263 void AttachLayers();
269 void RemoveLayers(); 264 void RemoveLayers();
270 265
271 void CreateOverscrollEffectIfNecessary(); 266 void CreateOverscrollEffectIfNecessary();
272 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); 267 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata);
273 void ScheduleAnimationIfNecessary(); 268 void ScheduleAnimationIfNecessary();
274 269
270 bool UsingSynchronousCompositor() const;
no sievers 2013/11/15 20:15:20 remove this
powei 2013/11/15 22:41:28 Done.
271
275 // Called after async screenshot task completes. Scales and crops the result 272 // Called after async screenshot task completes. Scales and crops the result
276 // of the copy. 273 // of the copy.
277 static void PrepareTextureCopyOutputResult( 274 static void PrepareTextureCopyOutputResult(
278 const gfx::Size& dst_size_in_pixel, 275 const gfx::Size& dst_size_in_pixel,
279 const base::Callback<void(bool, const SkBitmap&)>& callback, 276 const base::Callback<void(bool, const SkBitmap&)>& callback,
280 scoped_ptr<cc::CopyOutputResult> result); 277 scoped_ptr<cc::CopyOutputResult> result);
281 static void PrepareBitmapCopyOutputResult( 278 static void PrepareBitmapCopyOutputResult(
282 const gfx::Size& dst_size_in_pixel, 279 const gfx::Size& dst_size_in_pixel,
283 const base::Callback<void(bool, const SkBitmap&)>& callback, 280 const base::Callback<void(bool, const SkBitmap&)>& callback,
284 scoped_ptr<cc::CopyOutputResult> result); 281 scoped_ptr<cc::CopyOutputResult> result);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 bool overscroll_effect_enabled_; 335 bool overscroll_effect_enabled_;
339 scoped_ptr<OverscrollGlow> overscroll_effect_; 336 scoped_ptr<OverscrollGlow> overscroll_effect_;
340 337
341 bool flush_input_requested_; 338 bool flush_input_requested_;
342 339
343 int accelerated_surface_route_id_; 340 int accelerated_surface_route_id_;
344 341
345 // Size to use if we have no backing ContentViewCore 342 // Size to use if we have no backing ContentViewCore
346 gfx::Size default_size_; 343 gfx::Size default_size_;
347 344
345 bool using_synchronous_compositor_;
346
348 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 347 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
349 }; 348 };
350 349
351 } // namespace content 350 } // namespace content
352 351
353 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 352 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698