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_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
7 | 7 |
8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
10 #endif | 10 #endif |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Notifies the View that the renderer selection bounds has changed. | 236 // Notifies the View that the renderer selection bounds has changed. |
237 // |start_rect| and |end_rect| are the bounds end of the selection in the | 237 // |start_rect| and |end_rect| are the bounds end of the selection in the |
238 // coordinate system of the render view. |start_direction| and |end_direction| | 238 // coordinate system of the render view. |start_direction| and |end_direction| |
239 // indicates the direction at which the selection was made on touch devices. | 239 // indicates the direction at which the selection was made on touch devices. |
240 virtual void SelectionBoundsChanged( | 240 virtual void SelectionBoundsChanged( |
241 const ViewHostMsg_SelectionBounds_Params& params) = 0; | 241 const ViewHostMsg_SelectionBounds_Params& params) = 0; |
242 | 242 |
243 // Notifies the view that the scroll offset has changed. | 243 // Notifies the view that the scroll offset has changed. |
244 virtual void ScrollOffsetChanged() = 0; | 244 virtual void ScrollOffsetChanged() = 0; |
245 | 245 |
246 // Copies the contents of the compositing surface into the given | 246 // Copies the contents of the compositing surface, providing a new SkBitmap |
247 // (uninitialized) PlatformCanvas if any. | 247 // result via an asynchronously-run |callback|. |src_subrect| is specified in |
248 // The rectangle region specified with |src_subrect| is copied from the | 248 // layer space coordinates for the current platform (e.g., DIP for Aura/Mac, |
249 // contents, scaled to |dst_size|, and written to |output|. | 249 // physical for Android), and is the region to be copied from this view. The |
250 // |callback| is invoked with true on success, false otherwise. |output| can | 250 // copy is then scaled to a SkBitmap of size |dst_size|. |callback| is run |
251 // be initialized even on failure. | 251 // with true on success, false otherwise. A smaller region than |src_subrect| |
252 // A smaller region than |src_subrect| may be copied if the underlying surface | 252 // may be copied if the underlying surface is smaller than |src_subrect|. |
253 // is smaller than |src_subrect|. | |
254 // NOTE: |callback| is called asynchronously. | |
255 virtual void CopyFromCompositingSurface( | 253 virtual void CopyFromCompositingSurface( |
256 const gfx::Rect& src_subrect, | 254 const gfx::Rect& src_subrect, |
257 const gfx::Size& dst_size, | 255 const gfx::Size& dst_size, |
258 const base::Callback<void(bool, const SkBitmap&)>& callback, | 256 const base::Callback<void(bool, const SkBitmap&)>& callback, |
259 const SkColorType color_type) = 0; | 257 const SkColorType color_type) = 0; |
260 | 258 |
261 // Copies a given subset of the compositing surface's content into a YV12 | 259 // Copies the contents of the compositing surface, populating the given |
262 // VideoFrame, and invokes a callback with a success/fail parameter. |target| | 260 // |target| with YV12 image data. |src_subrect| is specified in layer space |
263 // must contain an allocated, YV12 video frame of the intended size. If the | 261 // coordinates for the current platform (e.g., DIP for Aura/Mac, physical for |
264 // copy rectangle does not match |target|'s size, the copied content will be | 262 // Android), and is the region to be copied from this view. The copy is then |
265 // scaled and letterboxed with black borders. The copy will happen | 263 // scaled and letterboxed with black borders to fit |target|. Finally, |
266 // asynchronously. This operation will fail if there is no available | 264 // |callback| is asynchronously run with true/false for |
| 265 // success/failure. |target| must point to an allocated, YV12 video frame of |
| 266 // the intended size. This operation will fail if there is no available |
267 // compositing surface. | 267 // compositing surface. |
268 virtual void CopyFromCompositingSurfaceToVideoFrame( | 268 virtual void CopyFromCompositingSurfaceToVideoFrame( |
269 const gfx::Rect& src_subrect, | 269 const gfx::Rect& src_subrect, |
270 const scoped_refptr<media::VideoFrame>& target, | 270 const scoped_refptr<media::VideoFrame>& target, |
271 const base::Callback<void(bool)>& callback) = 0; | 271 const base::Callback<void(bool)>& callback) = 0; |
272 | 272 |
273 // Returns true if CopyFromCompositingSurfaceToVideoFrame() is likely to | 273 // Returns true if CopyFromCompositingSurfaceToVideoFrame() is likely to |
274 // succeed. | 274 // succeed. |
275 // | 275 // |
276 // TODO(nick): When VideoFrame copies are broadly implemented, this method | 276 // TODO(nick): When VideoFrame copies are broadly implemented, this method |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 uint32 renderer_frame_number_; | 427 uint32 renderer_frame_number_; |
428 | 428 |
429 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; | 429 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; |
430 | 430 |
431 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 431 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
432 }; | 432 }; |
433 | 433 |
434 } // namespace content | 434 } // namespace content |
435 | 435 |
436 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 436 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |