Chromium Code Reviews| 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_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/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // be initialized even on failure. | 177 // be initialized even on failure. |
| 178 // A smaller region than |src_subrect| may be copied if the underlying surface | 178 // A smaller region than |src_subrect| may be copied if the underlying surface |
| 179 // is smaller than |src_subrect|. | 179 // is smaller than |src_subrect|. |
| 180 // NOTE: |callback| is called asynchronously. | 180 // NOTE: |callback| is called asynchronously. |
| 181 virtual void CopyFromCompositingSurface( | 181 virtual void CopyFromCompositingSurface( |
| 182 const gfx::Rect& src_subrect, | 182 const gfx::Rect& src_subrect, |
| 183 const gfx::Size& dst_size, | 183 const gfx::Size& dst_size, |
| 184 const base::Callback<void(bool, const SkBitmap&)>& callback, | 184 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 185 const SkBitmap::Config config) = 0; | 185 const SkBitmap::Config config) = 0; |
| 186 | 186 |
| 187 // For async implementation of copy, we provide a lock to ensure that the | |
| 188 // content is not evicted while copying. | |
|
no sievers
2014/02/21 02:34:10
I'd say that it instructs the view to not drop the
powei
2014/02/21 18:41:15
Done.
| |
| 189 virtual void LockSurfaceForCopy() = 0; | |
| 190 virtual void UnlockSurfaceForCopy() = 0; | |
| 191 | |
| 187 // Copies a given subset of the compositing surface's content into a YV12 | 192 // Copies a given subset of the compositing surface's content into a YV12 |
| 188 // VideoFrame, and invokes a callback with a success/fail parameter. |target| | 193 // VideoFrame, and invokes a callback with a success/fail parameter. |target| |
| 189 // must contain an allocated, YV12 video frame of the intended size. If the | 194 // must contain an allocated, YV12 video frame of the intended size. If the |
| 190 // copy rectangle does not match |target|'s size, the copied content will be | 195 // copy rectangle does not match |target|'s size, the copied content will be |
| 191 // scaled and letterboxed with black borders. The copy will happen | 196 // scaled and letterboxed with black borders. The copy will happen |
| 192 // asynchronously. This operation will fail if there is no available | 197 // asynchronously. This operation will fail if there is no available |
| 193 // compositing surface. | 198 // compositing surface. |
| 194 virtual void CopyFromCompositingSurfaceToVideoFrame( | 199 virtual void CopyFromCompositingSurfaceToVideoFrame( |
| 195 const gfx::Rect& src_subrect, | 200 const gfx::Rect& src_subrect, |
| 196 const scoped_refptr<media::VideoFrame>& target, | 201 const scoped_refptr<media::VideoFrame>& target, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 | 351 |
| 347 // Returns an HWND that's given as the parent window for windowless Flash to | 352 // Returns an HWND that's given as the parent window for windowless Flash to |
| 348 // workaround crbug.com/301548. | 353 // workaround crbug.com/301548. |
| 349 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const = 0; | 354 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const = 0; |
| 350 #endif | 355 #endif |
| 351 }; | 356 }; |
| 352 | 357 |
| 353 } // namespace content | 358 } // namespace content |
| 354 | 359 |
| 355 #endif // CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ | 360 #endif // CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ |
| OLD | NEW |