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 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 125 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
126 int gpu_host_id) OVERRIDE; | 126 int gpu_host_id) OVERRIDE; |
127 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 127 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
128 virtual void AcceleratedSurfaceRelease() OVERRIDE; | 128 virtual void AcceleratedSurfaceRelease() OVERRIDE; |
129 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; | 129 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
130 virtual void SetBackgroundOpaque(bool transparent) OVERRIDE; | 130 virtual void SetBackgroundOpaque(bool transparent) OVERRIDE; |
131 virtual void CopyFromCompositingSurface( | 131 virtual void CopyFromCompositingSurface( |
132 const gfx::Rect& src_subrect, | 132 const gfx::Rect& src_subrect, |
133 const gfx::Size& dst_size, | 133 const gfx::Size& dst_size, |
134 const base::Callback<void(bool, const SkBitmap&)>& callback, | 134 const base::Callback<void(bool, const SkBitmap&)>& callback, |
135 const SkBitmap::Config config) OVERRIDE; | 135 const SkColorType color_type) OVERRIDE; |
136 virtual void CopyFromCompositingSurfaceToVideoFrame( | 136 virtual void CopyFromCompositingSurfaceToVideoFrame( |
137 const gfx::Rect& src_subrect, | 137 const gfx::Rect& src_subrect, |
138 const scoped_refptr<media::VideoFrame>& target, | 138 const scoped_refptr<media::VideoFrame>& target, |
139 const base::Callback<void(bool)>& callback) OVERRIDE; | 139 const base::Callback<void(bool)>& callback) OVERRIDE; |
140 virtual bool CanCopyToVideoFrame() const OVERRIDE; | 140 virtual bool CanCopyToVideoFrame() const OVERRIDE; |
141 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; | 141 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; |
142 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; | 142 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
143 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 143 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
144 virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, | 144 virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, |
145 InputEventAckState ack_result) OVERRIDE; | 145 InputEventAckState ack_result) OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 virtual void OnVSync(base::TimeTicks frame_time, | 179 virtual void OnVSync(base::TimeTicks frame_time, |
180 base::TimeDelta vsync_period) OVERRIDE; | 180 base::TimeDelta vsync_period) OVERRIDE; |
181 virtual void OnAnimate(base::TimeTicks begin_frame_time) OVERRIDE; | 181 virtual void OnAnimate(base::TimeTicks begin_frame_time) OVERRIDE; |
182 | 182 |
183 // ImageTransportFactoryAndroidObserver implementation. | 183 // ImageTransportFactoryAndroidObserver implementation. |
184 virtual void OnLostResources() OVERRIDE; | 184 virtual void OnLostResources() OVERRIDE; |
185 | 185 |
186 // DelegatedFrameEvictor implementation | 186 // DelegatedFrameEvictor implementation |
187 virtual void EvictDelegatedFrame() OVERRIDE; | 187 virtual void EvictDelegatedFrame() OVERRIDE; |
188 | 188 |
189 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; | 189 virtual SkColorType PreferredReadbackFormat() OVERRIDE; |
190 | 190 |
191 // GestureTextSelectorClient implementation. | 191 // GestureTextSelectorClient implementation. |
192 virtual void ShowSelectionHandlesAutomatically() OVERRIDE; | 192 virtual void ShowSelectionHandlesAutomatically() OVERRIDE; |
193 virtual void SelectRange(float x1, float y1, float x2, float y2) OVERRIDE; | 193 virtual void SelectRange(float x1, float y1, float x2, float y2) OVERRIDE; |
194 virtual void Unselect() OVERRIDE; | 194 virtual void Unselect() OVERRIDE; |
195 virtual void LongPress(base::TimeTicks time, float x, float y) OVERRIDE; | 195 virtual void LongPress(base::TimeTicks time, float x, float y) OVERRIDE; |
196 | 196 |
197 // Non-virtual methods | 197 // Non-virtual methods |
198 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 198 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
199 SkColor GetCachedBackgroundColor() const; | 199 SkColor GetCachedBackgroundColor() const; |
(...skipping 13 matching lines...) Expand all Loading... |
213 void ResetGestureDetection(); | 213 void ResetGestureDetection(); |
214 void SetDoubleTapSupportEnabled(bool enabled); | 214 void SetDoubleTapSupportEnabled(bool enabled); |
215 void SetMultiTouchZoomSupportEnabled(bool enabled); | 215 void SetMultiTouchZoomSupportEnabled(bool enabled); |
216 | 216 |
217 long GetNativeImeAdapter(); | 217 long GetNativeImeAdapter(); |
218 | 218 |
219 void WasResized(); | 219 void WasResized(); |
220 | 220 |
221 void GetScaledContentBitmap( | 221 void GetScaledContentBitmap( |
222 float scale, | 222 float scale, |
223 SkBitmap::Config bitmap_config, | 223 SkColorType color_type, |
224 gfx::Rect src_subrect, | 224 gfx::Rect src_subrect, |
225 const base::Callback<void(bool, const SkBitmap&)>& result_callback); | 225 const base::Callback<void(bool, const SkBitmap&)>& result_callback); |
226 | 226 |
227 bool HasValidFrame() const; | 227 bool HasValidFrame() const; |
228 | 228 |
229 void MoveCaret(const gfx::Point& point); | 229 void MoveCaret(const gfx::Point& point); |
230 | 230 |
231 void SynchronousFrameMetadata( | 231 void SynchronousFrameMetadata( |
232 const cc::CompositorFrameMetadata& frame_metadata); | 232 const cc::CompositorFrameMetadata& frame_metadata); |
233 | 233 |
(...skipping 20 matching lines...) Expand all Loading... |
254 void ResetClipping(); | 254 void ResetClipping(); |
255 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); | 255 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); |
256 | 256 |
257 void AttachLayers(); | 257 void AttachLayers(); |
258 void RemoveLayers(); | 258 void RemoveLayers(); |
259 | 259 |
260 // Called after async screenshot task completes. Scales and crops the result | 260 // Called after async screenshot task completes. Scales and crops the result |
261 // of the copy. | 261 // of the copy. |
262 static void PrepareTextureCopyOutputResult( | 262 static void PrepareTextureCopyOutputResult( |
263 const gfx::Size& dst_size_in_pixel, | 263 const gfx::Size& dst_size_in_pixel, |
264 const SkBitmap::Config config, | 264 const SkColorType color_type, |
265 const base::TimeTicks& start_time, | 265 const base::TimeTicks& start_time, |
266 const base::Callback<void(bool, const SkBitmap&)>& callback, | 266 const base::Callback<void(bool, const SkBitmap&)>& callback, |
267 scoped_ptr<cc::CopyOutputResult> result); | 267 scoped_ptr<cc::CopyOutputResult> result); |
268 static void PrepareTextureCopyOutputResultForDelegatedReadback( | 268 static void PrepareTextureCopyOutputResultForDelegatedReadback( |
269 const gfx::Size& dst_size_in_pixel, | 269 const gfx::Size& dst_size_in_pixel, |
270 const SkBitmap::Config config, | 270 const SkColorType color_type, |
271 const base::TimeTicks& start_time, | 271 const base::TimeTicks& start_time, |
272 scoped_refptr<cc::Layer> readback_layer, | 272 scoped_refptr<cc::Layer> readback_layer, |
273 const base::Callback<void(bool, const SkBitmap&)>& callback, | 273 const base::Callback<void(bool, const SkBitmap&)>& callback, |
274 scoped_ptr<cc::CopyOutputResult> result); | 274 scoped_ptr<cc::CopyOutputResult> result); |
275 | 275 |
276 // DevTools ScreenCast support for Android WebView. | 276 // DevTools ScreenCast support for Android WebView. |
277 void SynchronousCopyContents( | 277 void SynchronousCopyContents( |
278 const gfx::Rect& src_subrect_in_pixel, | 278 const gfx::Rect& src_subrect_in_pixel, |
279 const gfx::Size& dst_size_in_pixel, | 279 const gfx::Size& dst_size_in_pixel, |
280 const base::Callback<void(bool, const SkBitmap&)>& callback, | 280 const base::Callback<void(bool, const SkBitmap&)>& callback, |
281 const SkBitmap::Config config); | 281 const SkColorType color_type); |
282 | 282 |
283 bool IsReadbackConfigSupported(SkBitmap::Config bitmap_config); | 283 bool IsReadbackConfigSupported(SkColorType color_type); |
284 | 284 |
285 // If we have locks on a frame during a ContentViewCore swap or a context | 285 // If we have locks on a frame during a ContentViewCore swap or a context |
286 // lost, the frame is no longer valid and we can safely release all the locks. | 286 // lost, the frame is no longer valid and we can safely release all the locks. |
287 // Use this method to release all the locks. | 287 // Use this method to release all the locks. |
288 void ReleaseLocksOnSurface(); | 288 void ReleaseLocksOnSurface(); |
289 | 289 |
290 // Drop any incoming frames from the renderer when there are locks on the | 290 // Drop any incoming frames from the renderer when there are locks on the |
291 // current frame. | 291 // current frame. |
292 void RetainFrame(uint32 output_surface_id, | 292 void RetainFrame(uint32 output_surface_id, |
293 scoped_ptr<cc::CompositorFrame> frame); | 293 scoped_ptr<cc::CompositorFrame> frame); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 scoped_ptr<LastFrameInfo> last_frame_info_; | 371 scoped_ptr<LastFrameInfo> last_frame_info_; |
372 | 372 |
373 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 373 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
374 | 374 |
375 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 375 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
376 }; | 376 }; |
377 | 377 |
378 } // namespace content | 378 } // namespace content |
379 | 379 |
380 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 380 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |