summaryrefslogtreecommitdiffstats
path: root/cc/surfaces/surface.cc
diff options
context:
space:
mode:
authorjbauman <jbauman@chromium.org>2015-10-15 16:00:38 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-15 23:01:58 +0000
commit5ed9ab93dd9f448aac722483b6adc6b7a14cdf4b (patch)
tree67c2e7f5a59dac197b02e213917cc90ab1845ab9 /cc/surfaces/surface.cc
parent5c66039b36d17a9dcc6f07567f27338ae782ddc5 (diff)
downloadchromium_src-5ed9ab93dd9f448aac722483b6adc6b7a14cdf4b.zip
chromium_src-5ed9ab93dd9f448aac722483b6adc6b7a14cdf4b.tar.gz
chromium_src-5ed9ab93dd9f448aac722483b6adc6b7a14cdf4b.tar.bz2
Add mechanism to signal DelegatedFrameHost that a surface is about to draw.
This allows the FrameSubscriber to request a copy of the output even when the renderer it's subscribing to hasn't changed its contents, but a child renderer (oopif or webview) has. BUG=529378 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1365793002 Cr-Commit-Position: refs/heads/master@{#354390}
Diffstat (limited to 'cc/surfaces/surface.cc')
-rw-r--r--cc/surfaces/surface.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index 16987cb..e3b0f5e 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -98,11 +98,22 @@ void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) {
if (current_frame_ &&
- !current_frame_->delegated_frame_data->render_pass_list.empty())
- current_frame_->delegated_frame_data->render_pass_list.back()
- ->copy_requests.push_back(copy_request.Pass());
- else
+ !current_frame_->delegated_frame_data->render_pass_list.empty()) {
+ ScopedPtrVector<CopyOutputRequest>& copy_requests =
+ current_frame_->delegated_frame_data->render_pass_list.back()
+ ->copy_requests;
+
+ if (void* source = copy_request->source()) {
+ // Remove existing CopyOutputRequests made on the Surface by the same
+ // source.
+ auto to_remove = copy_requests.remove_if([source](
+ const CopyOutputRequest* x) { return x->source() == source; });
+ copy_requests.erase(to_remove, copy_requests.end());
+ }
+ copy_requests.push_back(copy_request.Pass());
+ } else {
copy_request->SendEmptyResult();
+ }
}
void Surface::TakeCopyOutputRequests(