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

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: Change RWHVA to add itself to the compositor as per sievers@ comment Created 7 years, 2 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
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/compositor_observer.h"
22 #include "content/browser/renderer_host/image_transport_factory_android.h" 23 #include "content/browser/renderer_host/image_transport_factory_android.h"
23 #include "content/browser/renderer_host/ime_adapter_android.h" 24 #include "content/browser/renderer_host/ime_adapter_android.h"
24 #include "content/browser/renderer_host/render_widget_host_view_base.h" 25 #include "content/browser/renderer_host/render_widget_host_view_base.h"
25 #include "gpu/command_buffer/common/mailbox.h" 26 #include "gpu/command_buffer/common/mailbox.h"
26 #include "third_party/skia/include/core/SkColor.h" 27 #include "third_party/skia/include/core/SkColor.h"
27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.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;
(...skipping 22 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,
66 public CompositorObserver,
67 public ImageTransportFactoryAndroidObserver { 67 public ImageTransportFactoryAndroidObserver {
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,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; 181 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE;
182 virtual void AccessibilityScrollToMakeVisible( 182 virtual void AccessibilityScrollToMakeVisible(
183 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; 183 int acc_obj_id, gfx::Rect subfocus) OVERRIDE;
184 virtual void AccessibilityScrollToPoint( 184 virtual void AccessibilityScrollToPoint(
185 int acc_obj_id, gfx::Point point) OVERRIDE; 185 int acc_obj_id, gfx::Point point) OVERRIDE;
186 virtual void AccessibilitySetTextSelection( 186 virtual void AccessibilitySetTextSelection(
187 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; 187 int acc_obj_id, int start_offset, int end_offset) OVERRIDE;
188 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; 188 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE;
189 virtual void FatalAccessibilityTreeError() OVERRIDE; 189 virtual void FatalAccessibilityTreeError() OVERRIDE;
190 190
191 // cc::TextureLayerClient implementation.
192 virtual unsigned PrepareTexture() OVERRIDE;
193 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE;
194 virtual bool PrepareTextureMailbox(
195 cc::TextureMailbox* mailbox,
196 scoped_ptr<cc::SingleReleaseCallback>* release_callback,
197 bool use_shared_memory) OVERRIDE;
198
199 // cc::DelegatedRendererLayerClient implementation.
200 virtual void DidCommitFrameData() OVERRIDE;
201
202 // cc::DelegatedFrameResourceCollectionClient implementation. 191 // cc::DelegatedFrameResourceCollectionClient implementation.
203 virtual void UnusedResourcesAreAvailable() OVERRIDE; 192 virtual void UnusedResourcesAreAvailable() OVERRIDE;
204 193
194 // content::CompositorObserver implementation.
195 virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE;
196
205 // ImageTransportFactoryAndroidObserver implementation. 197 // ImageTransportFactoryAndroidObserver implementation.
206 virtual void OnLostResources() OVERRIDE; 198 virtual void OnLostResources() OVERRIDE;
207 199
208 // Non-virtual methods 200 // Non-virtual methods
209 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 201 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
210 SkColor GetCachedBackgroundColor() const; 202 SkColor GetCachedBackgroundColor() const;
211 void SendKeyEvent(const NativeWebKeyboardEvent& event); 203 void SendKeyEvent(const NativeWebKeyboardEvent& event);
212 void SendTouchEvent(const WebKit::WebTouchEvent& event); 204 void SendTouchEvent(const WebKit::WebTouchEvent& event);
213 void SendMouseEvent(const WebKit::WebMouseEvent& event); 205 void SendMouseEvent(const WebKit::WebMouseEvent& event);
214 void SendMouseWheelEvent(const WebKit::WebMouseWheelEvent& event); 206 void SendMouseWheelEvent(const WebKit::WebMouseWheelEvent& event);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // of the copy. 265 // of the copy.
274 static void PrepareTextureCopyOutputResult( 266 static void PrepareTextureCopyOutputResult(
275 const gfx::Size& dst_size_in_pixel, 267 const gfx::Size& dst_size_in_pixel,
276 const base::Callback<void(bool, const SkBitmap&)>& callback, 268 const base::Callback<void(bool, const SkBitmap&)>& callback,
277 scoped_ptr<cc::CopyOutputResult> result); 269 scoped_ptr<cc::CopyOutputResult> result);
278 static void PrepareBitmapCopyOutputResult( 270 static void PrepareBitmapCopyOutputResult(
279 const gfx::Size& dst_size_in_pixel, 271 const gfx::Size& dst_size_in_pixel,
280 const base::Callback<void(bool, const SkBitmap&)>& callback, 272 const base::Callback<void(bool, const SkBitmap&)>& callback,
281 scoped_ptr<cc::CopyOutputResult> result); 273 scoped_ptr<cc::CopyOutputResult> result);
282 274
275 // Detaching the RenderWidgetHostView from ContentViewCore
276 void DetachFromContentViewCore(bool check_layers_attached);
277
283 // The model object. 278 // The model object.
284 RenderWidgetHostImpl* host_; 279 RenderWidgetHostImpl* host_;
285 280
286 // Used to track whether this render widget needs a BeginFrame. 281 // Used to track whether this render widget needs a BeginFrame.
287 bool needs_begin_frame_; 282 bool needs_begin_frame_;
288 283
289 // Whether or not this widget is potentially attached to the view hierarchy. 284 // Whether or not this widget is potentially attached to the view hierarchy.
290 // This view may not actually be attached if this is true, but it should be 285 // This view may not actually be attached if this is true, but it should be
291 // treated as such, because as soon as a ContentViewCore is set the layer 286 // treated as such, because as soon as a ContentViewCore is set the layer
292 // will be attached automatically. 287 // will be attached automatically.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 scoped_ptr<OverscrollGlow> overscroll_effect_; 329 scoped_ptr<OverscrollGlow> overscroll_effect_;
335 330
336 bool flush_input_requested_; 331 bool flush_input_requested_;
337 332
338 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 333 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
339 }; 334 };
340 335
341 } // namespace content 336 } // namespace content
342 337
343 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 338 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698