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

Side by Side Diff: content/renderer/child_frame_compositing_helper.cc

Issue 690263003: <webview>: Remove broken captureVisibleRegion code until feature is properly supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/renderer/child_frame_compositing_helper.h" 5 #include "content/renderer/child_frame_compositing_helper.h"
6 6
7 #include "cc/blink/web_layer_impl.h" 7 #include "cc/blink/web_layer_impl.h"
8 #include "cc/layers/delegated_frame_provider.h" 8 #include "cc/layers/delegated_frame_provider.h"
9 #include "cc/layers/delegated_frame_resource_collection.h" 9 #include "cc/layers/delegated_frame_resource_collection.h"
10 #include "cc/layers/delegated_renderer_layer.h" 10 #include "cc/layers/delegated_renderer_layer.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (GetBrowserPluginManager()) { 105 if (GetBrowserPluginManager()) {
106 GetBrowserPluginManager()->Send( 106 GetBrowserPluginManager()->Send(
107 new BrowserPluginHostMsg_ReclaimCompositorResources( 107 new BrowserPluginHostMsg_ReclaimCompositorResources(
108 host_routing_id_, GetInstanceID(), params)); 108 host_routing_id_, GetInstanceID(), params));
109 } else if (render_frame_proxy_) { 109 } else if (render_frame_proxy_) {
110 render_frame_proxy_->Send( 110 render_frame_proxy_->Send(
111 new FrameHostMsg_ReclaimCompositorResources(host_routing_id_, params)); 111 new FrameHostMsg_ReclaimCompositorResources(host_routing_id_, params));
112 } 112 }
113 } 113 }
114 114
115 void ChildFrameCompositingHelper::CopyFromCompositingSurface(
116 int request_id,
117 gfx::Rect source_rect,
118 gfx::Size dest_size) {
119 CHECK(background_layer_.get());
120 scoped_ptr<cc::CopyOutputRequest> request =
121 cc::CopyOutputRequest::CreateBitmapRequest(base::Bind(
122 &ChildFrameCompositingHelper::CopyFromCompositingSurfaceHasResult,
123 this,
124 request_id,
125 dest_size));
126 request->set_area(source_rect);
127 background_layer_->RequestCopyOfOutput(request.Pass());
128 }
129
130 void ChildFrameCompositingHelper::DidCommitCompositorFrame() { 115 void ChildFrameCompositingHelper::DidCommitCompositorFrame() {
131 if (!resource_collection_.get() || !ack_pending_) 116 if (!resource_collection_.get() || !ack_pending_)
132 return; 117 return;
133 118
134 FrameHostMsg_CompositorFrameSwappedACK_Params params; 119 FrameHostMsg_CompositorFrameSwappedACK_Params params;
135 params.producing_host_id = last_host_id_; 120 params.producing_host_id = last_host_id_;
136 params.producing_route_id = last_route_id_; 121 params.producing_route_id = last_route_id_;
137 params.output_surface_id = last_output_surface_id_; 122 params.output_surface_id = last_output_surface_id_;
138 resource_collection_->TakeUnusedResourcesForChildCompositor( 123 resource_collection_->TakeUnusedResourcesForChildCompositor(
139 &params.ack.resources); 124 &params.ack.resources);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 params.renderer_host_id = last_host_id_; 275 params.renderer_host_id = last_host_id_;
291 SendReclaimCompositorResourcesToBrowser(params); 276 SendReclaimCompositorResourcesToBrowser(params);
292 } 277 }
293 278
294 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) { 279 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) {
295 opaque_ = opaque; 280 opaque_ = opaque;
296 if (delegated_layer_.get()) 281 if (delegated_layer_.get())
297 delegated_layer_->SetContentsOpaque(opaque_); 282 delegated_layer_->SetContentsOpaque(opaque_);
298 } 283 }
299 284
300 void ChildFrameCompositingHelper::CopyFromCompositingSurfaceHasResult(
301 int request_id,
302 gfx::Size dest_size,
303 scoped_ptr<cc::CopyOutputResult> result) {
304 scoped_ptr<SkBitmap> bitmap;
305 if (result && result->HasBitmap() && !result->size().IsEmpty())
306 bitmap = result->TakeBitmap();
307
308 SkBitmap resized_bitmap;
309 if (bitmap) {
310 resized_bitmap =
311 skia::ImageOperations::Resize(*bitmap,
312 skia::ImageOperations::RESIZE_BEST,
313 dest_size.width(),
314 dest_size.height());
315 }
316 if (GetBrowserPluginManager()) {
317 GetBrowserPluginManager()->Send(
318 new BrowserPluginHostMsg_CopyFromCompositingSurfaceAck(
319 host_routing_id_, GetInstanceID(), request_id, resized_bitmap));
320 }
321 }
322
323 } // namespace content 285 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/child_frame_compositing_helper.h ('k') | extensions/browser/api/web_view/web_view_internal_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698