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

Side by Side Diff: content/port/browser/render_widget_host_view_port.h

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix per wjia Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.cc ('k') | media/base/video_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ 5 #ifndef CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_
6 #define CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ 6 #define CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/port/common/input_event_ack_state.h" 12 #include "content/port/common/input_event_ack_state.h"
13 #include "content/public/browser/render_widget_host_view.h" 13 #include "content/public/browser/render_widget_host_view.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
16 #include "ui/base/ime/text_input_type.h" 16 #include "ui/base/ime/text_input_type.h"
17 #include "ui/base/range/range.h" 17 #include "ui/base/range/range.h"
18 #include "ui/surface/transport_dib.h" 18 #include "ui/surface/transport_dib.h"
19 19
20 class SkBitmap; 20 class SkBitmap;
21 class WebCursor; 21 class WebCursor;
22 22
23 struct AccessibilityHostMsg_NotificationParams; 23 struct AccessibilityHostMsg_NotificationParams;
24 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; 24 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
25 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; 25 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params;
26 struct ViewHostMsg_TextInputState_Params; 26 struct ViewHostMsg_TextInputState_Params;
27 struct ViewHostMsg_SelectionBounds_Params; 27 struct ViewHostMsg_SelectionBounds_Params;
28 28
29 namespace media {
30 class VideoFrame;
31 }
32
29 namespace webkit { 33 namespace webkit {
30 namespace npapi { 34 namespace npapi {
31 struct WebPluginGeometry; 35 struct WebPluginGeometry;
32 } 36 }
33 } 37 }
34 38
35 namespace WebKit { 39 namespace WebKit {
36 struct WebScreenInfo; 40 struct WebScreenInfo;
37 } 41 }
38 42
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 155
152 // Allocate a backing store for this view. 156 // Allocate a backing store for this view.
153 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; 157 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0;
154 158
155 // Copies the contents of the compositing surface into the given 159 // Copies the contents of the compositing surface into the given
156 // (uninitialized) PlatformCanvas if any. 160 // (uninitialized) PlatformCanvas if any.
157 // The rectangle region specified with |src_subrect| is copied from the 161 // The rectangle region specified with |src_subrect| is copied from the
158 // contents, scaled to |dst_size|, and written to |output|. 162 // contents, scaled to |dst_size|, and written to |output|.
159 // |callback| is invoked with true on success, false otherwise. |output| can 163 // |callback| is invoked with true on success, false otherwise. |output| can
160 // be initialized even on failure. 164 // be initialized even on failure.
161 // NOTE: |callback| is called asynchronously on Aura and synchronously on the 165 // NOTE: |callback| is called asynchronously.
162 // other platforms.
163 virtual void CopyFromCompositingSurface( 166 virtual void CopyFromCompositingSurface(
164 const gfx::Rect& src_subrect, 167 const gfx::Rect& src_subrect,
165 const gfx::Size& dst_size, 168 const gfx::Size& dst_size,
166 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; 169 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0;
167 170
171 // Copies a given subset of the compositing surface's content into a YV12
172 // VideoFrame, and invokes a callback with a success/fail parameter. |target|
173 // must contain an allocated, YV12 video frame of the intended size. If the
174 // copy rectangle does not match |target|'s size, the copied content will be
175 // scaled and letterboxed with black borders. The copy will happen
176 // asynchronously. This operation will fail if there is no available
177 // compositing surface.
178 virtual void CopyFromCompositingSurfaceToVideoFrame(
179 const gfx::Rect& src_subrect,
180 const scoped_refptr<media::VideoFrame>& target,
181 const base::Callback<void(bool)>& callback) = 0;
182
183 // Returns true if CopyFromCompositingSurfaceToVideoFrame() is likely to
184 // succeed.
185 //
186 // TODO(nick): When VideoFrame copies are broadly implemented, this method
187 // should be renamed to HasCompositingSurface(), or unified with
188 // IsSurfaceAvailableForCopy() and HasAcceleratedSurface().
189 virtual bool CanCopyToVideoFrame() const = 0;
190
168 // Called when accelerated compositing state changes. 191 // Called when accelerated compositing state changes.
169 virtual void OnAcceleratedCompositingStateChange() = 0; 192 virtual void OnAcceleratedCompositingStateChange() = 0;
170 // |params.window| and |params.surface_id| indicate which accelerated 193 // |params.window| and |params.surface_id| indicate which accelerated
171 // surface's buffers swapped. |params.renderer_id| and |params.route_id| 194 // surface's buffers swapped. |params.renderer_id| and |params.route_id|
172 // are used to formulate a reply to the GPU process to prevent it from getting 195 // are used to formulate a reply to the GPU process to prevent it from getting
173 // too far ahead. They may all be zero, in which case no flow control is 196 // too far ahead. They may all be zero, in which case no flow control is
174 // enforced; this case is currently used for accelerated plugins. 197 // enforced; this case is currently used for accelerated plugins.
175 virtual void AcceleratedSurfaceBuffersSwapped( 198 virtual void AcceleratedSurfaceBuffersSwapped(
176 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, 199 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel,
177 int gpu_host_id) = 0; 200 int gpu_host_id) = 0;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 virtual BrowserAccessibilityManager* 309 virtual BrowserAccessibilityManager*
287 GetBrowserAccessibilityManager() const = 0; 310 GetBrowserAccessibilityManager() const = 0;
288 virtual void OnAccessibilityNotifications( 311 virtual void OnAccessibilityNotifications(
289 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { 312 const std::vector<AccessibilityHostMsg_NotificationParams>& params) {
290 } 313 }
291 }; 314 };
292 315
293 } // namespace content 316 } // namespace content
294 317
295 #endif // CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ 318 #endif // CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.cc ('k') | media/base/video_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698