| Index: content/browser/frame_host/render_widget_host_view_child_frame.cc
|
| diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
|
| index be109468cc4034d53d1e0e6df900c7172f131ec8..e3991b26eb0adf42170297b983cd0bc00855af2e 100644
|
| --- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
|
| +++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
|
| @@ -9,6 +9,8 @@
|
| #include <vector>
|
|
|
| #include "build/build_config.h"
|
| +#include "cc/output/copy_output_request.h"
|
| +#include "cc/output/copy_output_result.h"
|
| #include "cc/surfaces/surface.h"
|
| #include "cc/surfaces/surface_factory.h"
|
| #include "cc/surfaces/surface_manager.h"
|
| @@ -18,6 +20,7 @@
|
| #include "content/browser/compositor/surface_utils.h"
|
| #include "content/browser/frame_host/cross_process_frame_connector.h"
|
| #include "content/browser/gpu/compositor_util.h"
|
| +#include "content/browser/readback_request_helpers.h"
|
| #include "content/browser/renderer_host/render_view_host_impl.h"
|
| #include "content/browser/renderer_host/render_widget_host_delegate.h"
|
| #include "content/browser/renderer_host/render_widget_host_impl.h"
|
| @@ -426,11 +429,21 @@ bool RenderWidgetHostViewChildFrame::PostProcessEventForPluginIme(
|
| #endif // defined(OS_MACOSX)
|
|
|
| void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface(
|
| - const gfx::Rect& /* src_subrect */,
|
| - const gfx::Size& /* dst_size */,
|
| + const gfx::Rect& src_subrect,
|
| + const gfx::Size& output_size,
|
| const ReadbackRequestCallback& callback,
|
| - const SkColorType /* preferred_color_type */) {
|
| - callback.Run(SkBitmap(), READBACK_FAILED);
|
| + const SkColorType preferred_color_type) {
|
| + if (!surface_factory_ || surface_id_.is_null())
|
| + callback.Run(SkBitmap(), READBACK_FAILED);
|
| +
|
| + scoped_ptr<cc::CopyOutputRequest> request =
|
| + cc::CopyOutputRequest::CreateRequest(
|
| + base::Bind(&CopyFromCompositingSurfaceHasResult, output_size,
|
| + preferred_color_type, callback));
|
| + if (!src_subrect.IsEmpty())
|
| + request->set_area(src_subrect);
|
| +
|
| + surface_factory_->RequestCopyOfSurface(surface_id_, std::move(request));
|
| }
|
|
|
| void RenderWidgetHostViewChildFrame::CopyFromCompositingSurfaceToVideoFrame(
|
|
|