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 #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/texture_layer_client.h" | 18 #include "cc/layers/texture_layer_client.h" |
19 #include "cc/output/begin_frame_args.h" | 19 #include "cc/output/begin_frame_args.h" |
20 #include "content/browser/accessibility/browser_accessibility_manager.h" | 20 #include "content/browser/accessibility/browser_accessibility_manager.h" |
21 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 21 #include "content/browser/renderer_host/delegated_frame_evictor.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 "content/public/browser/android/content_view_core.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/base/android/window_android_observer.h" | 29 #include "ui/base/android/window_android_observer.h" |
29 #include "ui/gfx/size.h" | 30 #include "ui/gfx/size.h" |
30 #include "ui/gfx/vector2d_f.h" | 31 #include "ui/gfx/vector2d_f.h" |
31 | 32 |
32 struct ViewHostMsg_TextInputState_Params; | 33 struct ViewHostMsg_TextInputState_Params; |
33 | 34 |
34 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 35 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 133 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
133 int gpu_host_id) OVERRIDE; | 134 int gpu_host_id) OVERRIDE; |
134 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 135 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
135 virtual void AcceleratedSurfaceRelease() OVERRIDE; | 136 virtual void AcceleratedSurfaceRelease() OVERRIDE; |
136 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; | 137 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
137 virtual void SetBackground(const SkBitmap& background) OVERRIDE; | 138 virtual void SetBackground(const SkBitmap& background) OVERRIDE; |
138 virtual void CopyFromCompositingSurface( | 139 virtual void CopyFromCompositingSurface( |
139 const gfx::Rect& src_subrect, | 140 const gfx::Rect& src_subrect, |
140 const gfx::Size& dst_size, | 141 const gfx::Size& dst_size, |
141 const base::Callback<void(bool, const SkBitmap&)>& callback, | 142 const base::Callback<void(bool, const SkBitmap&)>& callback, |
142 const SkBitmap::Config config) OVERRIDE; | 143 const SkBitmap::Config config, |
| 144 scoped_ptr<SkBitmap> bitmap) OVERRIDE; |
143 virtual void CopyFromCompositingSurfaceToVideoFrame( | 145 virtual void CopyFromCompositingSurfaceToVideoFrame( |
144 const gfx::Rect& src_subrect, | 146 const gfx::Rect& src_subrect, |
145 const scoped_refptr<media::VideoFrame>& target, | 147 const scoped_refptr<media::VideoFrame>& target, |
146 const base::Callback<void(bool)>& callback) OVERRIDE; | 148 const base::Callback<void(bool)>& callback) OVERRIDE; |
147 virtual bool CanCopyToVideoFrame() const OVERRIDE; | 149 virtual bool CanCopyToVideoFrame() const OVERRIDE; |
148 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; | 150 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; |
149 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; | 151 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
150 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 152 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
151 virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, | 153 virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, |
152 InputEventAckState ack_result) OVERRIDE; | 154 InputEventAckState ack_result) OVERRIDE; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 221 |
220 void LockResources(); | 222 void LockResources(); |
221 void UnlockResources(); | 223 void UnlockResources(); |
222 | 224 |
223 int GetNativeImeAdapter(); | 225 int GetNativeImeAdapter(); |
224 | 226 |
225 void WasResized(); | 227 void WasResized(); |
226 | 228 |
227 void GetScaledContentBitmap( | 229 void GetScaledContentBitmap( |
228 float scale, | 230 float scale, |
229 const base::Callback<void(bool, const SkBitmap&)>& result_callback); | 231 const base::Callback<void(bool, const SkBitmap&)>& result_callback, |
| 232 SkBitmap::Config bitmap_config, |
| 233 const gfx::Rect& bounding_rect, |
| 234 const BitmapAllocator bitmap_allocator); |
230 bool PopulateBitmapWithContents(jobject jbitmap); | 235 bool PopulateBitmapWithContents(jobject jbitmap); |
231 | 236 |
232 bool HasValidFrame() const; | 237 bool HasValidFrame() const; |
233 | 238 |
234 // Select all text between the given coordinates. | 239 // Select all text between the given coordinates. |
235 void SelectRange(const gfx::Point& start, const gfx::Point& end); | 240 void SelectRange(const gfx::Point& start, const gfx::Point& end); |
236 | 241 |
237 void MoveCaret(const gfx::Point& point); | 242 void MoveCaret(const gfx::Point& point); |
238 | 243 |
239 // Returns true when animation ticks are still needed. This avoids a separate | 244 // Returns true when animation ticks are still needed. This avoids a separate |
(...skipping 28 matching lines...) Expand all Loading... |
268 void RemoveLayers(); | 273 void RemoveLayers(); |
269 | 274 |
270 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); | 275 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); |
271 | 276 |
272 // Called after async screenshot task completes. Scales and crops the result | 277 // Called after async screenshot task completes. Scales and crops the result |
273 // of the copy. | 278 // of the copy. |
274 static void PrepareTextureCopyOutputResult( | 279 static void PrepareTextureCopyOutputResult( |
275 const gfx::Size& dst_size_in_pixel, | 280 const gfx::Size& dst_size_in_pixel, |
276 const SkBitmap::Config config, | 281 const SkBitmap::Config config, |
277 const base::TimeTicks& start_time, | 282 const base::TimeTicks& start_time, |
| 283 scoped_ptr<SkBitmap> bitmap, |
278 const base::Callback<void(bool, const SkBitmap&)>& callback, | 284 const base::Callback<void(bool, const SkBitmap&)>& callback, |
279 scoped_ptr<cc::CopyOutputResult> result); | 285 scoped_ptr<cc::CopyOutputResult> result); |
280 static void PrepareBitmapCopyOutputResult( | 286 static void PrepareBitmapCopyOutputResult( |
281 const gfx::Size& dst_size_in_pixel, | 287 const gfx::Size& dst_size_in_pixel, |
282 const SkBitmap::Config config, | 288 const SkBitmap::Config config, |
283 const base::TimeTicks& start_time, | 289 const base::TimeTicks& start_time, |
284 const base::Callback<void(bool, const SkBitmap&)>& callback, | 290 const base::Callback<void(bool, const SkBitmap&)>& callback, |
285 scoped_ptr<cc::CopyOutputResult> result); | 291 scoped_ptr<cc::CopyOutputResult> result); |
286 | 292 |
287 // DevTools ScreenCast support for Android WebView. | 293 // DevTools ScreenCast support for Android WebView. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 361 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
356 | 362 |
357 bool using_delegated_renderer_; | 363 bool using_delegated_renderer_; |
358 | 364 |
359 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 365 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
360 }; | 366 }; |
361 | 367 |
362 } // namespace content | 368 } // namespace content |
363 | 369 |
364 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 370 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |